[][src]Struct unmp::net::Net

pub struct Net { /* fields omitted */ }

网络层

Implementations

impl Net[src]

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]

更新路由

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.