[−][src]Struct unmp::net::NET
网络层实例
Methods from Deref<Target = Net>
pub fn set_id(&self, id: Id)
[src]
设置本机ID
pub fn set_relay(&self, relay: bool)
[src]
设置中继开关
pub fn add_link(&self, link: Link, is_parent: bool)
[src]
添加本地链路
pub fn register_protocol(
&self,
id: u8,
cb: Box<dyn Fn(&Id, &[u8]) + Send + Sync + 'static>
)
[src]
&self,
id: u8,
cb: Box<dyn Fn(&Id, &[u8]) + Send + Sync + 'static>
)
注册子协议的数据包接收函数
pub fn send(
&self,
protocol: u8,
data: &[u8],
id: Option<&Id>,
link: Option<&Link>
)
[src]
&self,
protocol: u8,
data: &[u8],
id: Option<&Id>,
link: Option<&Link>
)
发送数据包到链路接口
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,