Skip to main content

AirClient

Struct AirClient 

Source
pub struct AirClient {
    client: Option<Arc<Mutex<AirServiceClient<Channel>>>>,
    address: String,
}
Expand description

Air gRPC client wrapper.

Thread-safe via Arc<Mutex<…>>. Clones share the same underlying channel - clone is cheap (Arc ref-count bump). The address field is kept as the string the caller passed in so logs / Debug see the original form (http://[::1]:50053, etc.).

Fields§

§client: Option<Arc<Mutex<AirServiceClient<Channel>>>>

Underlying tonic gRPC client wrapped in Arc<Mutex<>> for shared, thread-safe access from multiple call sites.

§address: String

Address of the Air daemon.

Implementations§

Source§

impl AirClient

Source

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

Authenticates a user with the Air daemon.

§Arguments
  • request_id - opaque correlation id; see module docs.
  • username / password - credentials.
  • provider - authentication provider name (e.g. "github", "gitlab", "microsoft").
§Returns

On Ok, the session token string from the daemon.

Source§

impl AirClient

Source

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

Applies an update package.

§Arguments
  • request_id - opaque correlation id.
  • version - the version string of the update being applied.
  • update_path - filesystem path of the downloaded update bundle.
Source§

impl AirClient

Source

pub async fn CheckForUpdates( &self, request_id: String, current_version: String, channel: String, ) -> Result<Struct, AirError>

Checks for available updates.

§Arguments
  • request_id - opaque correlation id.
  • current_version - the currently-running application version.
  • channel - update channel ("stable", "beta", "nightly").
Source§

impl AirClient

Source

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

Downloads an update package.

§Arguments
  • request_id - opaque correlation id.
  • url - HTTPS URL of the update package.
  • destination_path - local filesystem path the package writes to.
  • checksum - SHA-256 hex string; empty disables verification.
  • headers - extra HTTP headers (e.g. "Authorization").
Source§

impl AirClient

Source

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

Downloads a file.

§Arguments
  • request_id - opaque correlation id.
  • url - HTTPS URL of the file.
  • destination_path - local filesystem path the file writes to.
  • checksum - SHA-256 hex string; empty disables verification.
  • headers - extra HTTP headers.
Source§

impl AirClient

Source

pub async fn DownloadStream( &self, request_id: String, url: String, headers: HashMap<String, String>, ) -> Result<Struct, AirError>

Starts a streaming download.

§Arguments
  • request_id - opaque correlation id.
  • url - HTTPS URL of the file.
  • headers - extra HTTP headers (e.g. "Authorization").
Source§

impl AirClient

Source

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

Gets extended file information.

Source§

impl AirClient

Source

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

Indexes files in a directory.

§Arguments
  • request_id - opaque correlation id.
  • path - root directory.
  • patterns - glob include list (empty = include all).
  • exclude_patterns - glob exclude list.
  • max_depth - recursion bound; 0 indexes only path itself.
Source§

impl AirClient

Source

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

Searches the index for files matching query.

§Arguments
  • request_id - opaque correlation id.
  • query - search expression (provider-defined syntax).
  • path - root path to scope the search; empty = whole index.
  • max_results - hard cap on hits returned.
Source§

impl AirClient

Source

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

Gets metrics from the Air daemon.

§Arguments
  • request_id - opaque correlation id.
  • metric_type - optional filter ("performance" / "resources" / "requests"). None requests the full metric set.
Source§

impl AirClient

Source

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

Gets daemon resource-usage stats.

Source§

impl AirClient

Source

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

Gets the Air daemon status snapshot.

Source§

impl AirClient

Source

pub async fn HealthCheck(&self) -> Result<bool, AirError>

Performs a health check on the Air daemon.

Source§

impl AirClient

Source

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

Sets daemon resource ceilings.

§Arguments
  • request_id - opaque correlation id.
  • memory_limit_mb - max resident memory.
  • cpu_limit_percent - max CPU utilisation (whole percent).
  • disk_limit_mb - max disk-usage budget.
Source§

impl AirClient

Source

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

Reads a configuration section from the daemon.

Source§

impl AirClient

Source

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

Updates configuration for the given section.

Source§

impl AirClient

Source

pub async fn new(address: &str) -> Result<Self, AirError>

Connects to the Air daemon at address and returns a ready-to-use client.

§Arguments
  • address - gRPC server address (e.g. "http://[::1]:50053").
§Errors
Source

pub fn is_connected(&self) -> bool

Whether the client is connected to the Air daemon.

Source

pub fn address(&self) -> &str

Address of the Air daemon.

Source

pub(crate) fn Client(&self) -> Option<&Arc<Mutex<AirServiceClient<Channel>>>>

Borrow the underlying tonic client for issuing RPCs. Returns None when the client is disconnected. Per-domain method impls call this and then .lock().await to obtain the mutex guard before issuing the RPC.

Trait Implementations§

Source§

impl Clone for AirClient

Source§

fn clone(&self) -> AirClient

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 AirClient

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,