pub enum ResolvedTransportRouting {
Forward {
pseudonym: HoprPseudonym,
forward_path: ValidatedPath,
return_paths: Vec<ValidatedPath>,
},
Return(HoprSenderId, HoprSurb),
}
Expand description
Contains the resolved routing information for the packet.
Instance of this object is typically constructed via some resolution of a
DestinationRouting
instance.
It contains the actual forward and return paths for forward packets, or an actual SURB for return (reply) packets.
Variants§
Forward
Concrete routing information for a forward packet.
Fields
§
pseudonym: HoprPseudonym
Pseudonym of the sender.
§
forward_path: ValidatedPath
Forward path.
§
return_paths: Vec<ValidatedPath>
Optional list of return paths.
Return(HoprSenderId, HoprSurb)
Sender ID and the corresponding SURB.
Implementations§
Source§impl ResolvedTransportRouting
impl ResolvedTransportRouting
Sourcepub const fn is_forward(&self) -> bool
pub const fn is_forward(&self) -> bool
Returns true if the enum is ResolvedTransportRouting::Forward otherwise false
Source§impl ResolvedTransportRouting
impl ResolvedTransportRouting
Sourcepub fn forward_only(forward_path: ValidatedPath) -> Self
pub fn forward_only(forward_path: ValidatedPath) -> Self
Shortcut for routing that does not create any SURBs for a return path.
Sourcepub fn count_return_paths(&self) -> usize
pub fn count_return_paths(&self) -> usize
Returns the number of return paths (SURBs) on the ResolvedTransportRouting::Forward
variant, or always 0 on the ResolvedTransportRouting::Return
variant.
Trait Implementations§
Source§impl Clone for ResolvedTransportRouting
impl Clone for ResolvedTransportRouting
Source§fn clone(&self) -> ResolvedTransportRouting
fn clone(&self) -> ResolvedTransportRouting
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ResolvedTransportRouting
impl RefUnwindSafe for ResolvedTransportRouting
impl Send for ResolvedTransportRouting
impl Sync for ResolvedTransportRouting
impl Unpin for ResolvedTransportRouting
impl UnwindSafe for ResolvedTransportRouting
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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