Enum ForwardedMetaPacket

Source
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.

§next_node: <S::P as Keypair>::Public

Public key of the next hop.

§path_pos: u8

Position in the channel path of this packet.

§additional_info: H::RelayerData

Additional 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: SharedSecret

Shared secret that was used to encrypt the removed layer.

§packet_tag: PacketTag

Packet checksum.

§

Final

The content is the actual payload for the packet’s destination.

Fields

§plain_text: PaddedPayload<P>

Decrypted payload

§receiver_data: H::PacketReceiverData

Data for the packet receiver (containing the sender’s pseudonym).

§derived_secret: SharedSecret

Shared secret that was used to encrypt the removed layer.

§packet_tag: PacketTag

Packet checksum.

§no_ack: bool

Special flag used for acknowledgement signaling to the recipient

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>

§

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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,