pub struct CachingPathManager<F: PathFetcher = PathFetcherImpl> { /* private fields */ }Expand description
Active path manager that runs as a background task
Implementations§
Source§impl<F: PathFetcher + Send + Sync + 'static> CachingPathManager<F>
impl<F: PathFetcher + Send + Sync + 'static> CachingPathManager<F>
Sourcepub fn start(path_strategy: PathStrategy, fetcher: F) -> Self
pub fn start(path_strategy: PathStrategy, fetcher: F) -> Self
Create and start an active path manager with automatic task management. The background task is spawned internally and will be cancelled when the manager is dropped. This is the recommended method for most users.
Sourcepub fn start_future(
selection: PathStrategy,
fetcher: F,
cancellation_token: CancellationToken,
) -> (Self, impl Future<Output = ()>)
pub fn start_future( selection: PathStrategy, fetcher: F, cancellation_token: CancellationToken, ) -> (Self, impl Future<Output = ()>)
Create the manager and task future.
Trait Implementations§
Source§impl<F: PathFetcher> Drop for CachingPathManager<F>
impl<F: PathFetcher> Drop for CachingPathManager<F>
Source§impl<F: PathFetcher + Send + Sync + 'static> PathManager for CachingPathManager<F>
impl<F: PathFetcher + Send + Sync + 'static> PathManager for CachingPathManager<F>
Source§impl<F: PathFetcher + Send + Sync + 'static> PathPrefetcher for CachingPathManager<F>
impl<F: PathFetcher + Send + Sync + 'static> PathPrefetcher for CachingPathManager<F>
Source§fn prefetch_path(&self, src: IsdAsn, dst: IsdAsn)
fn prefetch_path(&self, src: IsdAsn, dst: IsdAsn)
Prefetch a paths for the given source and destination.
Source§impl<F: PathFetcher + Send + Sync + 'static> SyncPathManager for CachingPathManager<F>
impl<F: PathFetcher + Send + Sync + 'static> SyncPathManager for CachingPathManager<F>
Source§fn try_cached_path(
&self,
src: IsdAsn,
dst: IsdAsn,
now: DateTime<Utc>,
) -> Result<Option<Path<Bytes>>>
fn try_cached_path( &self, src: IsdAsn, dst: IsdAsn, now: DateTime<Utc>, ) -> Result<Option<Path<Bytes>>>
Returns a cached path if it is not expired or prefetches it if it is not in the cache. If the path is not in the cache, it returns Ok(None). If the cache is locked an io error WouldBlock is returned.
Auto Trait Implementations§
impl<F> Freeze for CachingPathManager<F>
impl<F = PathFetcherImpl> !RefUnwindSafe for CachingPathManager<F>
impl<F> Send for CachingPathManager<F>
impl<F> Sync for CachingPathManager<F>
impl<F> Unpin for CachingPathManager<F>
impl<F = PathFetcherImpl> !UnwindSafe for CachingPathManager<F>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request