Skip to main content

InterfaceHandle

Trait InterfaceHandle 

Source
pub trait InterfaceHandle:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn get(&self) -> Ipv4Addr;
    fn set(&self, addr: Ipv4Addr);
}
Expand description

Shared handle to the local interface address.

Abstracts over Arc<RwLock<Ipv4Addr>> on std. All clones of a Client share the same handle, so writes from one clone (e.g. Client::set_interface) are visible to all others.

On bare metal, where Client is not Clone, a trivial implementation wrapping a core::cell::Cell<Ipv4Addr> suffices.

Required Methods§

Source

fn get(&self) -> Ipv4Addr

Returns the current interface address.

Source

fn set(&self, addr: Ipv4Addr)

Updates the stored interface address.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl InterfaceHandle for Arc<RwLock<Ipv4Addr>>

Source§

fn get(&self) -> Ipv4Addr

Source§

fn set(&self, addr: Ipv4Addr)

Implementors§