Skip to main content

ActionWire

Enum ActionWire 

Source
pub enum ActionWire {
    SendOnInterface {
        interface: u64,
        raw: Vec<u8>,
    },
    BroadcastOnAllInterfaces {
        raw: Vec<u8>,
        exclude: u64,
        has_exclude: u8,
    },
    DeliverLocal {
        destination_hash: [u8; 16],
        raw: Vec<u8>,
        packet_hash: [u8; 32],
        receiving_interface: u64,
    },
    AnnounceReceived {
        destination_hash: [u8; 16],
        identity_hash: [u8; 16],
        public_key: [u8; 64],
        name_hash: [u8; 10],
        random_hash: [u8; 10],
        app_data: Option<Vec<u8>>,
        hops: u8,
        receiving_interface: u64,
    },
    PathUpdated {
        destination_hash: [u8; 16],
        hops: u8,
        next_hop: [u8; 16],
        interface: u64,
    },
    ForwardToLocalClients {
        raw: Vec<u8>,
        exclude: u64,
        has_exclude: u8,
    },
    ForwardPlainBroadcast {
        raw: Vec<u8>,
        to_local: u8,
        exclude: u64,
        has_exclude: u8,
    },
    CacheAnnounce {
        packet_hash: [u8; 32],
        raw: Vec<u8>,
    },
    TunnelSynthesize {
        interface: u64,
        data: Vec<u8>,
        dest_hash: [u8; 16],
    },
    TunnelEstablished {
        tunnel_id: [u8; 32],
        interface: u64,
    },
}
Expand description

Wire-format enum mirroring TransportAction with raw primitives.

Uses u64 for interface IDs and [u8; N] for hashes so that rns-hooks has zero dependency on rns-core. Conversions happen at call sites.

Data fields use owned Vec<u8> — the data is copied from WASM linear memory when the action is parsed, so ActionWire values remain valid after the store is dropped.

Variants§

§

SendOnInterface

Fields

§interface: u64
§raw: Vec<u8>
§

BroadcastOnAllInterfaces

Fields

§raw: Vec<u8>
§exclude: u64
§has_exclude: u8
§

DeliverLocal

Fields

§destination_hash: [u8; 16]
§raw: Vec<u8>
§packet_hash: [u8; 32]
§receiving_interface: u64
§

AnnounceReceived

Fields

§destination_hash: [u8; 16]
§identity_hash: [u8; 16]
§public_key: [u8; 64]
§name_hash: [u8; 10]
§random_hash: [u8; 10]
§app_data: Option<Vec<u8>>
§hops: u8
§receiving_interface: u64
§

PathUpdated

Fields

§destination_hash: [u8; 16]
§hops: u8
§next_hop: [u8; 16]
§interface: u64
§

ForwardToLocalClients

Fields

§raw: Vec<u8>
§exclude: u64
§has_exclude: u8
§

ForwardPlainBroadcast

Fields

§raw: Vec<u8>
§to_local: u8
§exclude: u64
§has_exclude: u8
§

CacheAnnounce

Fields

§packet_hash: [u8; 32]
§raw: Vec<u8>
§

TunnelSynthesize

Fields

§interface: u64
§data: Vec<u8>
§dest_hash: [u8; 16]
§

TunnelEstablished

Fields

§tunnel_id: [u8; 32]
§interface: u64

Trait Implementations§

Source§

impl Clone for ActionWire

Source§

fn clone(&self) -> ActionWire

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionWire

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.