pub struct AirVinegRPCService {
AppState: Arc<ApplicationState>,
AuthService: Arc<AuthenticationService>,
UpdateManager: Arc<UpdateManager>,
DownloadManager: Arc<DownloadManager>,
FileIndexer: Arc<FileIndexer>,
ActiveConnections: Arc<RwLock<HashMap<String, ConnectionMetadata>>>,
}Expand description
The concrete implementation of the Air gRPC service
Fields§
§AppState: Arc<ApplicationState>Application state
AuthService: Arc<AuthenticationService>Authentication service
UpdateManager: Arc<UpdateManager>Update manager
DownloadManager: Arc<DownloadManager>Download manager
FileIndexer: Arc<FileIndexer>File indexer
ActiveConnections: Arc<RwLock<HashMap<String, ConnectionMetadata>>>Connection tracking
Implementations§
Source§impl AirVinegRPCService
impl AirVinegRPCService
Sourcepub fn new(
AppState: Arc<ApplicationState>,
AuthService: Arc<AuthenticationService>,
UpdateManager: Arc<UpdateManager>,
DownloadManager: Arc<DownloadManager>,
FileIndexer: Arc<FileIndexer>,
) -> Self
pub fn new( AppState: Arc<ApplicationState>, AuthService: Arc<AuthenticationService>, UpdateManager: Arc<UpdateManager>, DownloadManager: Arc<DownloadManager>, FileIndexer: Arc<FileIndexer>, ) -> Self
Creates a new instance of the Air gRPC service
Sourceasync fn TrackConnection<RequestType>(
&self,
Request: &Request<RequestType>,
_ServiceName: &str,
) -> Result<String, Status>
async fn TrackConnection<RequestType>( &self, Request: &Request<RequestType>, _ServiceName: &str, ) -> Result<String, Status>
Track connection for a request
Sourcefn validate_protocol_version(&self, ClientVersion: u32) -> Result<(), Status>
fn validate_protocol_version(&self, ClientVersion: u32) -> Result<(), Status>
Validate protocol version compatibility
Source§impl AirVinegRPCService
impl AirVinegRPCService
Sourcefn detect_mime_type(&self, path: &Path) -> String
fn detect_mime_type(&self, path: &Path) -> String
Detect MIME type based on file extension
Sourceasync fn download_file_with_retry(
&self,
request_id: &str,
url: String,
DestinationPath: String,
checksum: String,
progress_callback: Option<Box<dyn Fn(f32) + Send>>,
) -> Result<DownloadResult>
async fn download_file_with_retry( &self, request_id: &str, url: String, DestinationPath: String, checksum: String, progress_callback: Option<Box<dyn Fn(f32) + Send>>, ) -> Result<DownloadResult>
Download file with exponential backoff retry Returns file_info (path, size, checksum) from DownloadManager
Sourceasync fn validate_range_support(&self, url: &str) -> Result<bool>
async fn validate_range_support(&self, url: &str) -> Result<bool>
Validate URL supports range headers for streaming
Sourceasync fn prepare_rollback_backup(&self, version: &str) -> Result<()>
async fn prepare_rollback_backup(&self, version: &str) -> Result<()>
Prepare rollback backup before applying update
Sourceasync fn cleanup_rollback_backup(&self, version: &str) -> Result<()>
async fn cleanup_rollback_backup(&self, version: &str) -> Result<()>
Cleanup rollback backup after successful update or failed verification
Sourceasync fn perform_rollback(&self, version: &str) -> Result<()>
async fn perform_rollback(&self, version: &str) -> Result<()>
Perform rollback to previous version
Trait Implementations§
Source§impl AirService for AirVinegRPCService
impl AirService for AirVinegRPCService
Source§type DownloadStreamStream = ReceiverStream<Result<DownloadStreamResponse, Status>>
type DownloadStreamStream = ReceiverStream<Result<DownloadStreamResponse, Status>>
Handle streaming download requests with bidirectional streaming and chunk delivery
Source§fn authenticate<'life0, 'async_trait>(
&'life0 self,
Request: Request<AuthenticationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AuthenticationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn authenticate<'life0, 'async_trait>(
&'life0 self,
Request: Request<AuthenticationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AuthenticationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle authentication requests from Mountain
Source§fn check_for_updates<'life0, 'async_trait>(
&'life0 self,
request: Request<UpdateCheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<UpdateCheckResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_for_updates<'life0, 'async_trait>(
&'life0 self,
request: Request<UpdateCheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<UpdateCheckResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle update check requests from Mountain
Source§fn download_file<'life0, 'async_trait>(
&'life0 self,
request: Request<DownloadRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<DownloadResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn download_file<'life0, 'async_trait>(
&'life0 self,
request: Request<DownloadRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<DownloadResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle download requests from Mountain
Source§fn index_files<'life0, 'async_trait>(
&'life0 self,
request: Request<IndexRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<IndexResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn index_files<'life0, 'async_trait>(
&'life0 self,
request: Request<IndexRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<IndexResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle file indexing requests from Mountain
Source§fn get_status<'life0, 'async_trait>(
&'life0 self,
request: Request<StatusRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StatusResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_status<'life0, 'async_trait>(
&'life0 self,
request: Request<StatusRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StatusResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle status check requests from Mountain
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
_request: Request<HealthCheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<HealthCheckResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
_request: Request<HealthCheckRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<HealthCheckResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle service health check
Source§fn download_update<'life0, 'async_trait>(
&'life0 self,
request: Request<DownloadRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<DownloadResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn download_update<'life0, 'async_trait>(
&'life0 self,
request: Request<DownloadRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<DownloadResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle download update requests
Source§fn apply_update<'life0, 'async_trait>(
&'life0 self,
request: Request<ApplyUpdateRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ApplyUpdateResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_update<'life0, 'async_trait>(
&'life0 self,
request: Request<ApplyUpdateRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ApplyUpdateResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle apply update requests
Source§fn search_files<'life0, 'async_trait>(
&'life0 self,
request: Request<SearchRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SearchResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search_files<'life0, 'async_trait>(
&'life0 self,
request: Request<SearchRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SearchResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle file search requests
Source§fn get_file_info<'life0, 'async_trait>(
&'life0 self,
request: Request<FileInfoRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<FileInfoResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_file_info<'life0, 'async_trait>(
&'life0 self,
request: Request<FileInfoRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<FileInfoResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle get file info requests
Source§fn get_metrics<'life0, 'async_trait>(
&'life0 self,
request: Request<MetricsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MetricsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_metrics<'life0, 'async_trait>(
&'life0 self,
request: Request<MetricsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MetricsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle get metrics requests
Source§fn get_resource_usage<'life0, 'async_trait>(
&'life0 self,
request: Request<ResourceUsageRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ResourceUsageResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_resource_usage<'life0, 'async_trait>(
&'life0 self,
request: Request<ResourceUsageRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ResourceUsageResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle get resource usage requests
Source§fn set_resource_limits<'life0, 'async_trait>(
&'life0 self,
request: Request<ResourceLimitsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ResourceLimitsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_resource_limits<'life0, 'async_trait>(
&'life0 self,
request: Request<ResourceLimitsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ResourceLimitsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle set resource limits requests
Source§fn get_configuration<'life0, 'async_trait>(
&'life0 self,
request: Request<ConfigurationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConfigurationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_configuration<'life0, 'async_trait>(
&'life0 self,
request: Request<ConfigurationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConfigurationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle get configuration requests
Source§fn update_configuration<'life0, 'async_trait>(
&'life0 self,
request: Request<UpdateConfigurationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<UpdateConfigurationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_configuration<'life0, 'async_trait>(
&'life0 self,
request: Request<UpdateConfigurationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<UpdateConfigurationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle update configuration requests
fn download_stream<'life0, 'async_trait>(
&'life0 self,
request: Request<DownloadStreamRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::DownloadStreamStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Clone for AirVinegRPCService
impl Clone for AirVinegRPCService
Source§fn clone(&self) -> AirVinegRPCService
fn clone(&self) -> AirVinegRPCService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AirVinegRPCService
impl !RefUnwindSafe for AirVinegRPCService
impl Send for AirVinegRPCService
impl Sync for AirVinegRPCService
impl Unpin for AirVinegRPCService
impl !UnwindSafe for AirVinegRPCService
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>
§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::Request§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].