Skip to main content

LinkManagerAction

Enum LinkManagerAction 

Source
pub enum LinkManagerAction {
Show 15 variants SendPacket { raw: Vec<u8>, dest_type: u8, attached_interface: Option<InterfaceId>, }, LinkEstablished { link_id: LinkId, dest_hash: [u8; 16], rtt: f64, is_initiator: bool, }, LinkClosed { link_id: LinkId, reason: Option<TeardownReason>, }, RemoteIdentified { link_id: LinkId, identity_hash: [u8; 16], public_key: [u8; 64], }, RegisterLinkDest { link_id: LinkId, }, DeregisterLinkDest { link_id: LinkId, }, ManagementRequest { link_id: LinkId, path_hash: [u8; 16], data: Vec<u8>, request_id: [u8; 16], remote_identity: Option<([u8; 16], [u8; 64])>, }, ResourceReceived { link_id: LinkId, data: Vec<u8>, metadata: Option<Vec<u8>>, }, ResourceCompleted { link_id: LinkId, }, ResourceFailed { link_id: LinkId, error: String, }, ResourceProgress { link_id: LinkId, received: usize, total: usize, }, ResourceAcceptQuery { link_id: LinkId, resource_hash: Vec<u8>, transfer_size: u64, has_metadata: bool, }, ChannelMessageReceived { link_id: LinkId, msgtype: u16, payload: Vec<u8>, }, LinkDataReceived { link_id: LinkId, context: u8, data: Vec<u8>, }, ResponseReceived { link_id: LinkId, request_id: [u8; 16], data: Vec<u8>, },
}
Expand description

Actions produced by LinkManager for the driver to dispatch.

Variants§

§

SendPacket

Send a packet via the transport engine outbound path.

Fields

§raw: Vec<u8>
§dest_type: u8
§attached_interface: Option<InterfaceId>
§

LinkEstablished

Link established — notify callbacks.

Fields

§link_id: LinkId
§dest_hash: [u8; 16]
§rtt: f64
§is_initiator: bool
§

LinkClosed

Link closed — notify callbacks.

Fields

§link_id: LinkId
§

RemoteIdentified

Remote peer identified — notify callbacks.

Fields

§link_id: LinkId
§identity_hash: [u8; 16]
§public_key: [u8; 64]
§

RegisterLinkDest

Register a link_id as local destination in transport (for receiving link data).

Fields

§link_id: LinkId
§

DeregisterLinkDest

Deregister a link_id from transport local destinations.

Fields

§link_id: LinkId
§

ManagementRequest

A management request that needs to be handled by the driver. The driver has access to engine state needed to build the response.

Fields

§link_id: LinkId
§path_hash: [u8; 16]
§data: Vec<u8>

The request data (msgpack-encoded Value from the request array).

§request_id: [u8; 16]

The request_id (truncated hash of the packed request).

§remote_identity: Option<([u8; 16], [u8; 64])>
§

ResourceReceived

Resource data fully received and assembled.

Fields

§link_id: LinkId
§data: Vec<u8>
§metadata: Option<Vec<u8>>
§

ResourceCompleted

Resource transfer completed (proof validated on sender side).

Fields

§link_id: LinkId
§

ResourceFailed

Resource transfer failed.

Fields

§link_id: LinkId
§error: String
§

ResourceProgress

Resource transfer progress update.

Fields

§link_id: LinkId
§received: usize
§total: usize
§

ResourceAcceptQuery

Query application whether to accept an incoming resource (for AcceptApp strategy).

Fields

§link_id: LinkId
§resource_hash: Vec<u8>
§transfer_size: u64
§has_metadata: bool
§

ChannelMessageReceived

Channel message received on a link.

Fields

§link_id: LinkId
§msgtype: u16
§payload: Vec<u8>
§

LinkDataReceived

Generic link data received (CONTEXT_NONE).

Fields

§link_id: LinkId
§context: u8
§data: Vec<u8>
§

ResponseReceived

Response received on a link.

Fields

§link_id: LinkId
§request_id: [u8; 16]
§data: Vec<u8>

Trait Implementations§

Source§

impl Debug for LinkManagerAction

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