pub struct MessageRelay {
pub next_hop: Did,
pub destination: Did,
pub hop_budget: HopBudget,
pub stage: RouteStage,
pub path: Option<SignalingPath>,
}Expand description
The relay carrier of a payload (see the module documentation).
Every payload is sent under a carrier. A handler picks the transport by next_hop; a
forwarding hop chooses the next carrier from destination.
Fields§
§next_hop: DidThe node that handles the payload next.
destination: DidThe node the payload is routed toward.
A sender that does not know the final destination names next_hop here, and a later hop
re-aims the carrier with Self::reset_destination.
hop_budget: HopBudgetThe forwards the payload may still take.
stage: RouteStageThe delivery stage: the route’s aim, and whether it was handed past that aim.
path: Option<SignalingPath>The recorded path of connect signaling; None for every other, pathless, carrier.
Implementations§
Source§impl MessageRelay
impl MessageRelay
Sourcepub fn new(
hop: NextHop,
destination: Did,
hop_budget: HopBudget,
) -> MessageRelay
pub fn new( hop: NextHop, destination: Did, hop_budget: HopBudget, ) -> MessageRelay
A fresh carrier whose first hop is the delivery decision hop, stage included.
Sourcepub fn forward(&self, current: Did, hop: NextHop) -> Result<MessageRelay, Error>
pub fn forward(&self, current: Did, hop: NextHop) -> Result<MessageRelay, Error>
The carrier current sends on toward self.destination after the delivery decision
hop.
Pre: self was addressed to current; a carrier retracing a path takes exactly the
path’s next return hop.
Post: Ok spends exactly one forward, sets stage = hop.stage, and records current on
a signaling path; Err(RelayHopBudgetExhausted) is the drop of a payload that has taken
every forward it was given.
Sourcepub fn report(
&self,
current: Did,
destination: Did,
hop: NextHop,
) -> Result<MessageRelay, Error>
pub fn report( &self, current: Did, destination: Did, hop: NextHop, ) -> Result<MessageRelay, Error>
The fresh carrier of a report current sends for the request carried by self: it
holds HopBudget::MAX, as every fresh carrier does, whatever self has left.
Pre: self was addressed to current; hop was decided by the caller toward
destination.
Sourcepub fn reset_destination(&self, destination: Did) -> MessageRelay
pub fn reset_destination(&self, destination: Did) -> MessageRelay
The same carrier aimed at destination.
A sender that does not know the final destination names its next hop as the destination;
a hop that resolves a farther node re-aims the carrier here before forwarding it. A new
destination starts a new route, so the stage returns to RouteStage::TOWARD.
Trait Implementations§
Source§impl Clone for MessageRelay
impl Clone for MessageRelay
Source§fn clone(&self) -> MessageRelay
fn clone(&self) -> MessageRelay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageRelay
impl Debug for MessageRelay
Source§impl<'de> Deserialize<'de> for MessageRelay
impl<'de> Deserialize<'de> for MessageRelay
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageRelay, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageRelay, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for MessageRelay
Source§impl PartialEq for MessageRelay
impl PartialEq for MessageRelay
Source§impl Serialize for MessageRelay
impl Serialize for MessageRelay
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for MessageRelay
Auto Trait Implementations§
impl Forget for MessageRelay
impl Freeze for MessageRelay
impl Move for MessageRelay
impl RefUnwindSafe for MessageRelay
impl Send for MessageRelay
impl Sync for MessageRelay
impl Unpin for MessageRelay
impl UnsafeUnpin for MessageRelay
impl UnwindSafe for MessageRelay
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.