pub struct AirServiceProvider {
client: Arc<AirClient>,
}Expand description
High-level provider over AirClient. Holds the client in an
Arc so consumers can share one channel across the application.
Fields§
§client: Arc<AirClient>Shared underlying gRPC client.
Implementations§
Source§impl AirServiceProvider
impl AirServiceProvider
Sourcepub async fn CheckForUpdates(
&self,
current_version: String,
channel: String,
) -> Result<Option<Struct>, AirError>
pub async fn CheckForUpdates( &self, current_version: String, channel: String, ) -> Result<Option<Struct>, AirError>
Checks for an available update on the given channel
("stable" / "beta" / "nightly").
Returns Ok(Some(info)) when an update is offered and
Ok(None) when the daemon reports no update.
Source§impl AirServiceProvider
impl AirServiceProvider
Sourcepub async fn DownloadStream(
&self,
url: String,
headers: HashMap<String, String>,
) -> Result<Struct, AirError>
pub async fn DownloadStream( &self, url: String, headers: HashMap<String, String>, ) -> Result<Struct, AirError>
Starts a streaming download from url. The returned wrapper
yields DownloadStreamDTO::Struct items until
chunk.completed == true.
Source§impl AirServiceProvider
impl AirServiceProvider
Sourcepub async fn GetResourceUsage(&self) -> Result<Struct, AirError>
pub async fn GetResourceUsage(&self) -> Result<Struct, AirError>
Returns the daemon’s current resource-usage snapshot.
Source§impl AirServiceProvider
impl AirServiceProvider
Sourcepub async fn new(address: String) -> Result<Self, AirError>
pub async fn new(address: String) -> Result<Self, AirError>
Connects to the Air daemon at address and returns a ready-to-use
provider.
§Errors
Forwards any error from AirClient::new.
Sourcepub async fn NewDefault() -> Result<Self, AirError>
pub async fn NewDefault() -> Result<Self, AirError>
Connects using DEFAULT_AIR_SERVER_ADDRESS.
Sourcepub fn FromClient(Client: Arc<AirClient>) -> Self
pub fn FromClient(Client: Arc<AirClient>) -> Self
Wraps an existing AirClient handle. Useful when the gRPC
channel is created elsewhere or shared with a non-provider call
site.
Sourcepub fn IsConnected(&self) -> bool
pub fn IsConnected(&self) -> bool
Whether the underlying client is connected.
Trait Implementations§
Source§impl Clone for AirServiceProvider
impl Clone for AirServiceProvider
Source§fn clone(&self) -> AirServiceProvider
fn clone(&self) -> AirServiceProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AirServiceProvider
impl !RefUnwindSafe for AirServiceProvider
impl Send for AirServiceProvider
impl Sync for AirServiceProvider
impl Unpin for AirServiceProvider
impl UnsafeUnpin for AirServiceProvider
impl !UnwindSafe for AirServiceProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequestExt for T
impl<T> IntoRequestExt for T
fn into_request(self) -> Request<Self>where
Self: Sized,
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].