pub enum ForwardedMetaPacket<S: SphinxSuite, H: SphinxHeaderSpec, const P: usize> {
    Relayed {
        packet: MetaPacket<S, H, P>,
        next_node: <S::P as Keypair>::Public,
        path_pos: u8,
        additional_info: H::RelayerData,
        derived_secret: SharedSecret,
        packet_tag: PacketTag,
    },
    Final {
        plain_text: PaddedPayload<P>,
        receiver_data: H::PacketReceiverData,
        derived_secret: SharedSecret,
        packet_tag: PacketTag,
        no_ack: bool,
    },
}Expand description
Represent a MetaPacket with one layer of encryption removed, exposing the details
about the next hop.
There are two possible states - either the packet is intended for the recipient,
and is thus ForwardedMetaPacket::Final, or it is meant to be sent (relayed)
to the next hop - thus it is ForwardedMetaPacket::Relayed.
Variants§
Relayed
The content is another MetaPacket meant to be sent to the next hop.
Fields
packet: MetaPacket<S, H, P>Packet for the next hop.
additional_info: H::RelayerDataAdditional data for the relayer.
In HOPR protocol, this contains the PoR challenge that will be solved when we receive the acknowledgement after we forward the inner packet to the next hop.
derived_secret: SharedSecretShared secret that was used to encrypt the removed layer.
packet_tag: PacketTagPacket checksum.
Final
The content is the actual payload for the packet’s destination.
Fields
plain_text: PaddedPayload<P>Decrypted payload
receiver_data: H::PacketReceiverDataData for the packet receiver (containing the sender’s pseudonym).
derived_secret: SharedSecretShared secret that was used to encrypt the removed layer.
packet_tag: PacketTagPacket checksum.
Auto Trait Implementations§
impl<S, H, const P: usize> Freeze for ForwardedMetaPacket<S, H, P>where
    <<S as SphinxSuite>::P as Keypair>::Public: Freeze,
    <H as SphinxHeaderSpec>::RelayerData: Freeze,
    <H as SphinxHeaderSpec>::PacketReceiverData: Freeze,
impl<S, H, const P: usize> RefUnwindSafe for ForwardedMetaPacket<S, H, P>where
    <<S as SphinxSuite>::P as Keypair>::Public: RefUnwindSafe,
    <H as SphinxHeaderSpec>::RelayerData: RefUnwindSafe,
    <H as SphinxHeaderSpec>::PacketReceiverData: RefUnwindSafe,
    S: RefUnwindSafe,
    H: RefUnwindSafe,
impl<S, H, const P: usize> Send for ForwardedMetaPacket<S, H, P>where
    <<S as SphinxSuite>::P as Keypair>::Public: Send,
    <H as SphinxHeaderSpec>::RelayerData: Send,
    <H as SphinxHeaderSpec>::PacketReceiverData: Send,
    S: Send,
    H: Send,
impl<S, H, const P: usize> Sync for ForwardedMetaPacket<S, H, P>where
    <<S as SphinxSuite>::P as Keypair>::Public: Sync,
    <H as SphinxHeaderSpec>::RelayerData: Sync,
    <H as SphinxHeaderSpec>::PacketReceiverData: Sync,
    S: Sync,
    H: Sync,
impl<S, H, const P: usize> Unpin for ForwardedMetaPacket<S, H, P>where
    <<S as SphinxSuite>::P as Keypair>::Public: Unpin,
    <H as SphinxHeaderSpec>::RelayerData: Unpin,
    <H as SphinxHeaderSpec>::PacketReceiverData: Unpin,
    S: Unpin,
    H: Unpin,
impl<S, H, const P: usize> UnwindSafe for ForwardedMetaPacket<S, H, P>where
    <<S as SphinxSuite>::P as Keypair>::Public: UnwindSafe,
    <H as SphinxHeaderSpec>::RelayerData: UnwindSafe,
    <H as SphinxHeaderSpec>::PacketReceiverData: UnwindSafe,
    S: UnwindSafe,
    H: UnwindSafe,
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
§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>
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 more