pub struct Node {
pub id: u32,
pub pool: Arc<PacketBufferPool>,
pub schedule: Arc<Schedule>,
/* private fields */
}Fields§
§id: u32§pool: Arc<PacketBufferPool>§schedule: Arc<Schedule>Implementations§
Source§impl Node
impl Node
pub fn new(id: u32, address: &str, verbose: bool) -> Self
Sourcepub fn recv_once(&mut self, callback: fn(PacketView<'_>))
pub fn recv_once(&mut self, callback: fn(PacketView<'_>))
Receive a single packet and call the callback with the packet
Sourcepub fn recv(&mut self, callback: fn(PacketView<'_>))
pub fn recv(&mut self, callback: fn(PacketView<'_>))
Receive packets and call the callback with each packet
Sourcepub fn send(&mut self, packet: PacketBuffer<'static>, addr: SocketAddr)
pub fn send(&mut self, packet: PacketBuffer<'static>, addr: SocketAddr)
Send a packet without waiting for reply
Sourcepub fn send_await(
&mut self,
packet: PacketBuffer<'static>,
addr: SocketAddr,
callback: fn(PacketView<'_>),
)
pub fn send_await( &mut self, packet: PacketBuffer<'static>, addr: SocketAddr, callback: fn(PacketView<'_>), )
Send a packet and wait for reply
Auto Trait Implementations§
impl Freeze for Node
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more