pub struct MultiPathManager<F: PathFetcher = PathFetcherImpl>(/* private fields */);Expand description
Path manager managing multiple paths per src-dst pair.
Implementations§
Source§impl<F: PathFetcher> MultiPathManager<F>
impl<F: PathFetcher> MultiPathManager<F>
Sourcepub fn new(
config: MultiPathManagerConfig,
fetcher: F,
path_strategy: PathStrategy,
) -> Result<Self, MultiPathManagerConfigError>
pub fn new( config: MultiPathManagerConfig, fetcher: F, path_strategy: PathStrategy, ) -> Result<Self, MultiPathManagerConfigError>
Sourcepub fn cached_path(
&self,
src: IsdAsn,
dst: IsdAsn,
now: SystemTime,
) -> Option<ScionPath>
pub fn cached_path( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, ) -> Option<ScionPath>
Returns the cached active path for the given src-dst pair, if one is available.
If no active path is cached, returns None.
If the src-dst pair is not yet managed, starts managing it.
Sourcepub async fn path(
&self,
src: IsdAsn,
dst: IsdAsn,
now: SystemTime,
) -> Result<ScionPath, Arc<PathFetchError>>
pub async fn path( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, ) -> Result<ScionPath, Arc<PathFetchError>>
Gets the active path for the given src-dst pair.
If the src-dst pair is not yet managed, starts managing it, possibly waiting for the first path fetch.
Returns an error if no path is available after waiting.
Sourcepub fn weak_ref(&self) -> MultiPathManagerRef<F>
pub fn weak_ref(&self) -> MultiPathManagerRef<F>
Creates a weak reference to this MultiPathManager.
Upgrade it back to a strong handle with MultiPathManagerRef::upgrade.
Sourcepub fn stop_managing_paths(&self, src: IsdAsn, dst: IsdAsn)
pub fn stop_managing_paths(&self, src: IsdAsn, dst: IsdAsn)
Stops managing paths for the given src-dst pair.
Trait Implementations§
Source§impl<F> Clone for MultiPathManager<F>where
F: PathFetcher,
impl<F> Clone for MultiPathManager<F>where
F: PathFetcher,
Source§impl<F: PathFetcher> PathManager for MultiPathManager<F>
impl<F: PathFetcher> PathManager for MultiPathManager<F>
Source§fn path_wait(
&self,
src: IsdAsn,
dst: IsdAsn,
now: SystemTime,
) -> impl Future<Output = Result<ScionPath, PathWaitError>> + Send + '_
fn path_wait( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, ) -> impl Future<Output = Result<ScionPath, PathWaitError>> + Send + '_
Returns a path to the destination from the path cache or requests a new path from the
SCION Control Plane.
Source§fn path_timeout(
&self,
src: IsdAsn,
dst: IsdAsn,
now: SystemTime,
timeout: Duration,
) -> impl Future<Output = Result<ScionPath, PathWaitTimeoutError>> + Send + '_
fn path_timeout( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, timeout: Duration, ) -> impl Future<Output = Result<ScionPath, PathWaitTimeoutError>> + Send + '_
Returns a path to the destination from the path cache or requests a new path from the
SCION Control Plane, with a maximum wait time.
Source§impl<F: PathFetcher> PathPrefetcher for MultiPathManager<F>
impl<F: PathFetcher> PathPrefetcher for MultiPathManager<F>
Source§fn prefetch_path(&self, src: IsdAsn, dst: IsdAsn)
fn prefetch_path(&self, src: IsdAsn, dst: IsdAsn)
Prefetch a path for the given source and destination.
Source§impl<F: PathFetcher> ScmpErrorReceiver for MultiPathManager<F>
impl<F: PathFetcher> ScmpErrorReceiver for MultiPathManager<F>
Source§fn report_scmp_error(
&self,
scmp_error: ScmpErrorMessage,
_path: ScionDpPathViewRef<'_>,
)
fn report_scmp_error( &self, scmp_error: ScmpErrorMessage, _path: ScionDpPathViewRef<'_>, )
Reports a SCMP error. This function must return immediately and not block. Read more
Source§impl<F: PathFetcher> SendErrorReceiver for MultiPathManager<F>
impl<F: PathFetcher> SendErrorReceiver for MultiPathManager<F>
Source§fn report_send_error(&self, error: &ScionSocketSendError)
fn report_send_error(&self, error: &ScionSocketSendError)
Reports an error when sending a packet.
This function must return immediately and not block.
Source§impl<F: PathFetcher> SyncPathManager for MultiPathManager<F>
impl<F: PathFetcher> SyncPathManager for MultiPathManager<F>
Source§fn register_path(
&self,
_src: IsdAsn,
_dst: IsdAsn,
_now: SystemTime,
_path: ScionPath,
)
fn register_path( &self, _src: IsdAsn, _dst: IsdAsn, _now: SystemTime, _path: ScionPath, )
Add a path to the path cache. This can be used to register reverse paths.
Source§fn try_cached_path(
&self,
src: IsdAsn,
dst: IsdAsn,
now: SystemTime,
) -> Result<Option<ScionPath>>
fn try_cached_path( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, ) -> Result<Option<ScionPath>>
Returns a path to the destination from the path cache.
If the path is not in the cache, it returns Ok(None), possibly causing the path to be
fetched in the background. If the cache is locked an io error
WouldBlock is
returned.Auto Trait Implementations§
impl<F = PathFetcherImpl> !RefUnwindSafe for MultiPathManager<F>
impl<F = PathFetcherImpl> !UnwindSafe for MultiPathManager<F>
impl<F> Freeze for MultiPathManager<F>
impl<F> Send for MultiPathManager<F>
impl<F> Sync for MultiPathManager<F>
impl<F> Unpin for MultiPathManager<F>
impl<F> UnsafeUnpin for MultiPathManager<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§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