pub enum DestinationRouting {
Forward {
destination: Box<NodeId>,
pseudonym: Option<HoprPseudonym>,
forward_options: RoutingOptions,
return_options: Option<RoutingOptions>,
},
Return(SurbMatcher),
}Expand description
Routing information containing forward or return routing options.
Information in this object represents the minimum required basis to generate forward paths and return paths.
See also RoutingOptions.
Variants§
Forward
Forward routing using the destination node and path, with a possible return path.
Fields
§
pseudonym: Option<HoprPseudonym>Our pseudonym shown to the destination.
If not given, it will be resolved as random.
§
forward_options: RoutingOptionsThe path to the destination.
§
return_options: Option<RoutingOptions>Optional return path.
Return(SurbMatcher)
Return routing using a SURB with the given pseudonym.
Will fail if no SURB for this pseudonym is found.
Implementations§
Source§impl DestinationRouting
impl DestinationRouting
Sourcepub const fn is_forward(&self) -> bool
pub const fn is_forward(&self) -> bool
Returns true if the enum is DestinationRouting::Forward otherwise false
Source§impl DestinationRouting
impl DestinationRouting
Sourcepub fn forward_only<T: Into<NodeId>>(
destination: T,
forward_options: RoutingOptions,
) -> Self
pub fn forward_only<T: Into<NodeId>>( destination: T, forward_options: RoutingOptions, ) -> Self
Shortcut for routing that does not create any SURBs for a return path.
Trait Implementations§
Source§impl Clone for DestinationRouting
impl Clone for DestinationRouting
Source§fn clone(&self) -> DestinationRouting
fn clone(&self) -> DestinationRouting
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 moreSource§impl Debug for DestinationRouting
impl Debug for DestinationRouting
Source§impl<'de> Deserialize<'de> for DestinationRouting
impl<'de> Deserialize<'de> for DestinationRouting
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DestinationRouting
impl PartialEq for DestinationRouting
Source§impl Serialize for DestinationRouting
impl Serialize for DestinationRouting
impl Eq for DestinationRouting
impl StructuralPartialEq for DestinationRouting
Auto Trait Implementations§
impl Freeze for DestinationRouting
impl RefUnwindSafe for DestinationRouting
impl Send for DestinationRouting
impl Sync for DestinationRouting
impl Unpin for DestinationRouting
impl UnwindSafe for DestinationRouting
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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