pub struct StaticUnderlayDiscovery { /* private fields */ }Expand description
Implementation of the UnderlayDiscovery trait backed by a static, in-memory topology.
Unlike the endhost-API-backed discovery used by ScionStackBuilder::build, this does not
contact an endhost API and runs no background task. It is intended for fully-local UDP stacks
where the topology (SCION routers and the interfaces they serve) is known up front, e.g. from
configuration.
Implementations§
Source§impl StaticUnderlayDiscovery
impl StaticUnderlayDiscovery
Sourcepub fn new(routers: impl IntoIterator<Item = StaticUdpRouter>) -> Self
pub fn new(routers: impl IntoIterator<Item = StaticUdpRouter>) -> Self
Creates a new static underlay discovery from the given SCION routers.
Routers are grouped by ISD-AS into a single UnderlayInfo::Udp entry per ISD-AS, and a
direct next-hop lookup is built mapping each served PathInterface to the router’s
internal interface.
Trait Implementations§
Source§impl UnderlayDiscovery for StaticUnderlayDiscovery
impl UnderlayDiscovery for StaticUnderlayDiscovery
Source§fn underlays(&self, isd_as: IsdAsn) -> Vec<(IsdAsn, UnderlayInfo)>
fn underlays(&self, isd_as: IsdAsn) -> Vec<(IsdAsn, UnderlayInfo)>
Returns discovered underlays that match the given ISD-AS.
Wildcard ISD-ASes are supported.
The underlays are returned in the order of priority.
Source§fn isd_ases(&self) -> HashSet<IsdAsn>
fn isd_ases(&self) -> HashSet<IsdAsn>
Returns the set of ISD-ASes for which underlays are available.
Source§fn resolve_udp_underlay_next_hop(
&self,
interface: PathInterface,
) -> Option<SocketAddr>
fn resolve_udp_underlay_next_hop( &self, interface: PathInterface, ) -> Option<SocketAddr>
Resolves the next hop for the given ISD-AS and interface ID.
Auto Trait Implementations§
impl Freeze for StaticUnderlayDiscovery
impl RefUnwindSafe for StaticUnderlayDiscovery
impl Send for StaticUnderlayDiscovery
impl Sync for StaticUnderlayDiscovery
impl Unpin for StaticUnderlayDiscovery
impl UnsafeUnpin for StaticUnderlayDiscovery
impl UnwindSafe for StaticUnderlayDiscovery
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> 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