Skip to main content

Path

Trait Path 

Source
pub trait Path: Send + Debug {
    // Required methods
    fn carrier(&self) -> Carrier;
    fn relay_device(&self) -> Option<String>;
    fn prepare(
        &mut self,
        subject: &str,
        plain: &[u8],
    ) -> Result<Packet, OpenError>;
    fn transmit(&mut self, packet: &Packet) -> Result<(), OpenError>;
    fn receipt(
        &mut self,
        counter: u64,
        bound: Option<Deadline>,
    ) -> Result<bool, OpenError>;

    // Provided methods
    fn interrupt_handle(&self) -> Option<Stop> { ... }
    fn life(&self) -> Option<LinkLife> { ... }
    fn refuse_unsolicited(&self) -> Result<(), OpenError> { ... }
    fn direct_index(&self) -> Option<u32> { ... }
}
Expand description

A keyed carrier answers one crossing or one message deadline.

Required Methods§

Source

fn carrier(&self) -> Carrier

Source

fn relay_device(&self) -> Option<String>

Source

fn prepare(&mut self, subject: &str, plain: &[u8]) -> Result<Packet, OpenError>

§Errors

Invalid input, oversized message, or exhausted Noise nonce.

Source

fn transmit(&mut self, packet: &Packet) -> Result<(), OpenError>

§Errors

The transport could not move this prepared packet.

Source

fn receipt( &mut self, counter: u64, bound: Option<Deadline>, ) -> Result<bool, OpenError>

The bound exists only while this crossing is in flight.

§Errors

The carrier ended or the importing endpoint refused the crossing.

Provided Methods§

Source

fn interrupt_handle(&self) -> Option<Stop>

Source

fn life(&self) -> Option<LinkLife>

Source

fn refuse_unsolicited(&self) -> Result<(), OpenError>

§Errors

Unsolicited traffic or an observed carrier end.

Source

fn direct_index(&self) -> Option<u32>

The device’s local direct index; streams have none.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§