Skip to main content

AirServiceProvider

Struct AirServiceProvider 

Source
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

Source

pub async fn Authenticate( &self, username: String, password: String, provider: String, ) -> Result<String, AirError>

Authenticates a user against the named provider ("github", "gitlab", "microsoft", …) and returns the session token on success.

Source§

impl AirServiceProvider

Source

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

Source

pub async fn DownloadUpdate( &self, url: String, destination_path: String, checksum: String, ) -> Result<Struct, AirError>

Downloads an update package to destination_path. The optional checksum is forwarded as-is; an empty string skips server-side verification.

Source§

impl AirServiceProvider

Source

pub async fn DownloadFile( &self, url: String, destination_path: String, checksum: String, ) -> Result<Struct, AirError>

Downloads url to destination_path. The optional checksum is forwarded for server-side verification; an empty string skips verification.

Source§

impl AirServiceProvider

Source

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

Source

pub async fn GetFileInfo(&self, path: String) -> Result<Struct, AirError>

Returns metadata for the file at path (size, mime type, checksum, modified time).

Source§

impl AirServiceProvider

Source

pub async fn IndexFiles( &self, path: String, patterns: Vec<String>, exclude_patterns: Vec<String>, max_depth: u32, ) -> Result<Struct, AirError>

Indexes files under path. patterns includes globs to match; exclude_patterns filters those out. max_depth of 0 is unlimited.

Source§

impl AirServiceProvider

Source

pub async fn SearchFiles( &self, query: String, path: String, max_results: u32, ) -> Result<Vec<Struct>, AirError>

Searches for query under path. max_results of 0 is unlimited.

Source§

impl AirServiceProvider

Source

pub async fn GetMetrics( &self, metric_type: Option<String>, ) -> Result<Struct, AirError>

Fetches daemon metrics. metric_type of None returns all counters; common values are "performance", "resources", "requests".

Source§

impl AirServiceProvider

Source

pub async fn GetStatus(&self) -> Result<Struct, AirError>

Fetches the daemon’s runtime status snapshot.

Source§

impl AirServiceProvider

Source

pub async fn GetResourceUsage(&self) -> Result<Struct, AirError>

Returns the daemon’s current resource-usage snapshot.

Source§

impl AirServiceProvider

Source

pub async fn SetResourceLimits( &self, memory_limit_mb: u32, cpu_limit_percent: u32, disk_limit_mb: u32, ) -> Result<(), AirError>

Sets memory / CPU / disk caps on the daemon.

  • memory_limit_mb - memory budget in MB
  • cpu_limit_percent - 0-100
  • disk_limit_mb - disk budget in MB
Source§

impl AirServiceProvider

Source

pub async fn GetConfiguration( &self, section: String, ) -> Result<HashMap<String, String>, AirError>

Reads a configuration section as a key/value map. Common sections: "grpc", "authentication", "updates".

Source§

impl AirServiceProvider

Source

pub async fn UpdateConfiguration( &self, section: String, updates: HashMap<String, String>, ) -> Result<(), AirError>

Writes the key/value pairs in updates to the named configuration section. Keys not in updates are left untouched.

Source§

impl AirServiceProvider

Source

pub async fn ApplyUpdate( &self, version: String, update_path: String, ) -> Result<(), AirError>

Applies the update package at update_path and tags it with version for the daemon’s bookkeeping.

Source§

impl AirServiceProvider

Source

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.

Source

pub async fn NewDefault() -> Result<Self, AirError>

Source

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.

Source

pub fn Client(&self) -> &Arc<AirClient>

Shared reference to the underlying client.

Source

pub fn IsConnected(&self) -> bool

Whether the underlying client is connected.

Source

pub fn Address(&self) -> &str

Address of the Air daemon.

Trait Implementations§

Source§

impl Clone for AirServiceProvider

Source§

fn clone(&self) -> AirServiceProvider

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AirServiceProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> IntoRequestExt for T

Source§

fn into_request(self) -> Request<Self>
where Self: Sized,

§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,