pub enum LinkManagerAction {
Show 22 variants
SendPacket {
raw: Vec<u8>,
dest_type: u8,
attached_interface: Option<InterfaceId>,
},
LinkEstablished {
link_id: LinkId,
dest_hash: [u8; 16],
hops: u8,
rebalanced_at: Option<f64>,
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>>,
},
ResourceFileReceived {
link_id: LinkId,
resource: ReceivedResourceFile,
},
ResourceCompleted {
link_id: LinkId,
},
ResourceFailed {
link_id: LinkId,
error: String,
},
ResourceProgress {
link_id: LinkId,
received: usize,
total: usize,
},
ResourceStreamCompleted {
link_id: LinkId,
transfer_id: ResourceTransferId,
},
ResourceStreamFailed {
link_id: LinkId,
transfer_id: ResourceTransferId,
error: ResourceTransferError,
},
ResourceStreamProgress {
link_id: LinkId,
transfer_id: ResourceTransferId,
transferred: u64,
total: u64,
},
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>,
metadata: Option<Vec<u8>>,
},
RequestFailed {
link_id: LinkId,
request_id: [u8; 16],
reason: RequestFailure,
},
LinkRequestReceived {
link_id: LinkId,
receiving_interface: InterfaceId,
},
ProtocolViolation {
receiving_interface: InterfaceId,
},
}Expand description
Actions produced by LinkManager for the driver to dispatch.
Variants§
SendPacket
Send a packet via the transport engine outbound path.
LinkEstablished
Link established — notify callbacks.
Fields
LinkClosed
Link closed — notify callbacks.
RemoteIdentified
Remote peer identified — notify callbacks.
RegisterLinkDest
Register a link_id as local destination in transport (for receiving link data).
DeregisterLinkDest
Deregister a link_id from transport local destinations.
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
ResourceReceived
Resource data fully received and assembled.
ResourceFileReceived
A disk-backed Resource is ready for application ownership.
ResourceCompleted
Resource transfer completed (proof validated on sender side).
ResourceFailed
Resource transfer failed.
ResourceProgress
Resource transfer progress update.
ResourceStreamCompleted
ResourceStreamFailed
ResourceStreamProgress
ResourceAcceptQuery
Query application whether to accept an incoming resource (for AcceptApp strategy).
ChannelMessageReceived
Channel message received on a link.
LinkDataReceived
Generic link data received (CONTEXT_NONE).
ResponseReceived
Response received on a link.
RequestFailed
An outbound request failed.
LinkRequestReceived
A link request was received (for hook notification).
ProtocolViolation
A malformed link request was rejected on an interface.
Fields
receiving_interface: InterfaceIdTrait Implementations§
Auto Trait Implementations§
impl Freeze for LinkManagerAction
impl RefUnwindSafe for LinkManagerAction
impl Send for LinkManagerAction
impl Sync for LinkManagerAction
impl Unpin for LinkManagerAction
impl UnsafeUnpin for LinkManagerAction
impl UnwindSafe for LinkManagerAction
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
Source§impl<T> InterfaceConfigData for Twhere
T: Send + 'static,
impl<T> InterfaceConfigData for Twhere
T: Send + 'static,
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