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: StringAddress of the Air daemon.
Implementations§
Source§impl AirClient
impl AirClient
Source§impl AirClient
impl AirClient
Sourcepub async fn ApplyUpdate(
&self,
request_id: String,
version: String,
update_path: String,
) -> Result<(), AirError>
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
impl AirClient
Sourcepub async fn CheckForUpdates(
&self,
request_id: String,
current_version: String,
channel: String,
) -> Result<Struct, AirError>
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
impl AirClient
Sourcepub async fn DownloadUpdate(
&self,
request_id: String,
url: String,
destination_path: String,
checksum: String,
headers: HashMap<String, String>,
) -> Result<Struct, AirError>
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
impl AirClient
Sourcepub async fn DownloadFile(
&self,
request_id: String,
url: String,
destination_path: String,
checksum: String,
headers: HashMap<String, String>,
) -> Result<Struct, AirError>
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
impl AirClient
Sourcepub async fn IndexFiles(
&self,
request_id: String,
path: String,
patterns: Vec<String>,
exclude_patterns: Vec<String>,
max_depth: u32,
) -> Result<Struct, AirError>
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;0indexes onlypathitself.
Source§impl AirClient
impl AirClient
Sourcepub async fn SearchFiles(
&self,
request_id: String,
query: String,
path: String,
max_results: u32,
) -> Result<Vec<Struct>, AirError>
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
impl AirClient
Sourcepub async fn GetMetrics(
&self,
request_id: String,
metric_type: Option<String>,
) -> Result<Struct, AirError>
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").Nonerequests the full metric set.
Source§impl AirClient
impl AirClient
Sourcepub async fn HealthCheck(&self) -> Result<bool, AirError>
pub async fn HealthCheck(&self) -> Result<bool, AirError>
Performs a health check on the Air daemon.
Source§impl AirClient
impl AirClient
Sourcepub async fn SetResourceLimits(
&self,
request_id: String,
memory_limit_mb: u32,
cpu_limit_percent: u32,
disk_limit_mb: u32,
) -> Result<(), AirError>
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
impl AirClient
Sourcepub async fn new(address: &str) -> Result<Self, AirError>
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
AirError::Networkif the address parses as a tonicEndpointbut the underlying connection attempt fails.AirError::Validationif the address string is malformed.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Whether the client is connected to the Air daemon.
Sourcepub(crate) fn Client(&self) -> Option<&Arc<Mutex<AirServiceClient<Channel>>>>
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§
Auto Trait Implementations§
impl Freeze for AirClient
impl !RefUnwindSafe for AirClient
impl Send for AirClient
impl Sync for AirClient
impl Unpin for AirClient
impl UnsafeUnpin for AirClient
impl !UnwindSafe for AirClient
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].