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, &'static str>
pub fn new( config: MultiPathManagerConfig, fetcher: F, path_strategy: PathStrategy, ) -> Result<Self, &'static str>
Creates a new MultiPathManager.
Sourcepub fn try_path(
&self,
src: IsdAsn,
dst: IsdAsn,
now: SystemTime,
) -> Option<Path>
pub fn try_path( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, ) -> Option<Path>
Tries to get the active path for the given src-dst pair.
If no active path is set, 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<Path, Arc<PathFetchError>>
pub async fn path( &self, src: IsdAsn, dst: IsdAsn, now: SystemTime, ) -> Result<Path, 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.
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.
Sourcepub fn report_path_issue(
&self,
timestamp: SystemTime,
issue: IssueKind,
path: Option<&Path>,
)
pub fn report_path_issue( &self, timestamp: SystemTime, issue: IssueKind, path: Option<&Path>, )
report error
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§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 paths 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: &Path)
fn report_scmp_error(&self, scmp_error: ScmpErrorMessage, path: &Path)
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: DateTime<Utc>,
_path: Path<Bytes>,
)
fn register_path( &self, _src: IsdAsn, _dst: IsdAsn, _now: DateTime<Utc>, _path: Path<Bytes>, )
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: DateTime<Utc>,
) -> Result<Option<Path<Bytes>>>
fn try_cached_path( &self, src: IsdAsn, dst: IsdAsn, now: DateTime<Utc>, ) -> Result<Option<Path<Bytes>>>
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> Freeze for MultiPathManager<F>
impl<F = PathFetcherImpl> !RefUnwindSafe for MultiPathManager<F>
impl<F> Send for MultiPathManager<F>
impl<F> Sync for MultiPathManager<F>
impl<F> Unpin for MultiPathManager<F>
impl<F = PathFetcherImpl> !UnwindSafe 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
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