pub struct NetworkOptimizationManager { /* private fields */ }Expand description
Network Optimization Manager
Implementations§
Source§impl NetworkOptimizationManager
impl NetworkOptimizationManager
Sourcepub fn new(config: NetworkOptimizationConfig) -> Result<Self>
pub fn new(config: NetworkOptimizationConfig) -> Result<Self>
Create new network optimization manager
Sourcepub async fn start_resumable_download(
&self,
request: ResumableDownloadRequest,
) -> Result<String>
pub async fn start_resumable_download( &self, request: ResumableDownloadRequest, ) -> Result<String>
Start resumable download
Sourcepub fn get_download_progress(
&self,
download_id: &str,
) -> Result<Option<DownloadProgress>>
pub fn get_download_progress( &self, download_id: &str, ) -> Result<Option<DownloadProgress>>
Get download progress
Sourcepub async fn pause_download(&self, download_id: &str) -> Result<bool>
pub async fn pause_download(&self, download_id: &str) -> Result<bool>
Pause download
Sourcepub async fn resume_download(&self, download_id: &str) -> Result<bool>
pub async fn resume_download(&self, download_id: &str) -> Result<bool>
Resume download
Sourcepub async fn cancel_download(&self, download_id: &str) -> Result<bool>
pub async fn cancel_download(&self, download_id: &str) -> Result<bool>
Cancel download
Sourcepub async fn enable_p2p_sharing(&self, model_id: &str) -> Result<()>
pub async fn enable_p2p_sharing(&self, model_id: &str) -> Result<()>
Enable P2P model sharing
Sourcepub async fn discover_p2p_peers(&self) -> Result<Vec<String>>
pub async fn discover_p2p_peers(&self) -> Result<Vec<String>>
Discover P2P peers
Sourcepub async fn get_optimal_edge_server(&self) -> Result<Option<String>>
pub async fn get_optimal_edge_server(&self) -> Result<Option<String>>
Get optimal edge server
Sourcepub async fn check_network_quality(&self) -> Result<String>
pub async fn check_network_quality(&self) -> Result<String>
Check network quality
Sourcepub async fn enter_offline_mode(&self) -> Result<()>
pub async fn enter_offline_mode(&self) -> Result<()>
Enter offline mode
Sourcepub async fn exit_offline_mode(&self) -> Result<()>
pub async fn exit_offline_mode(&self) -> Result<()>
Exit offline mode and sync
Sourcepub async fn sync_offline_data(&self) -> Result<()>
pub async fn sync_offline_data(&self) -> Result<()>
Sync offline data
Sourcepub fn get_optimization_statistics(&self) -> Result<String>
pub fn get_optimization_statistics(&self) -> Result<String>
Get network optimization statistics
Auto Trait Implementations§
impl Freeze for NetworkOptimizationManager
impl RefUnwindSafe for NetworkOptimizationManager
impl Send for NetworkOptimizationManager
impl Sync for NetworkOptimizationManager
impl Unpin for NetworkOptimizationManager
impl UnsafeUnpin for NetworkOptimizationManager
impl UnwindSafe for NetworkOptimizationManager
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 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>
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