Interface

Trait Interface 

Source
pub trait Interface {
    // Required methods
    fn new() -> Self;
    fn send(&self, data: &[u8], to: Node) -> Result<(), Failure>;
    fn recv(&self, buffer: &mut [u8], from: Node) -> Result<usize, Failure>;
}

Required Methods§

Source

fn new() -> Self

Source

fn send(&self, data: &[u8], to: Node) -> Result<(), Failure>

Source

fn recv(&self, buffer: &mut [u8], from: Node) -> Result<usize, Failure>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Interface for Quic<T>

Source§

impl<T> Interface for Udp<T>