[][src]Struct unmp::net::NET

pub struct NET { /* fields omitted */ }

网络层实例

Methods from Deref<Target = Net>

pub fn set_id(&self, id: Id)[src]

设置本机ID

pub fn set_relay(&self, relay: bool)[src]

设置中继开关

添加本地链路

pub fn register_protocol(
    &self,
    id: u8,
    cb: Box<dyn Fn(&Id, &[u8]) + Send + Sync + 'static>
)
[src]

注册子协议的数据包接收函数

pub fn send(
    &self,
    protocol: u8,
    data: &[u8],
    id: Option<&Id>,
    link: Option<&Link>
)
[src]

发送数据包到链路接口

pub fn broadcast(&self, protocol: u8, data: &[u8])[src]

发送数据包到所有子设备

pub fn connect(&self, id: &Id, link: &Link)[src]

设置固定路由

pub fn update_route(&self, id: &Id, link: &Link)[src]

更新路由

Trait Implementations

impl Deref for NET[src]

type Target = Net

The resulting type after dereferencing.

impl LazyStatic for NET[src]

Auto Trait Implementations

impl RefUnwindSafe for NET

impl Send for NET

impl Sync for NET

impl Unpin for NET

impl UnwindSafe for NET

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.