pub struct Net<A: Address> { /* private fields */ }Implementations§
Source§impl<A: Address> Net<A>
impl<A: Address> Net<A>
pub fn server() -> Net<A>
pub fn client() -> Net<A>
pub fn needs_tick(&self) -> Timeout
pub fn is_receive_chunk_still_valid( &self, chunk: &mut ChunkOrEvent<'_, A>, ) -> bool
pub fn connect<CB: Callback<A>>( &mut self, cb: &mut CB, addr: A, ) -> (PeerId, Result<(), CB::Error>)
pub fn disconnect<CB: Callback<A>>( &mut self, cb: &mut CB, pid: PeerId, reason: &[u8], ) -> Result<(), CB::Error>
pub fn send_connless<CB: Callback<A>>( &mut self, cb: &mut CB, addr: A, data: &[u8], ) -> Result<(), Error<CB::Error>>
pub fn send<CB: Callback<A>>( &mut self, cb: &mut CB, chunk: Chunk<'_>, ) -> Result<(), Error<CB::Error>>
pub fn flush<CB: Callback<A>>( &mut self, cb: &mut CB, pid: PeerId, ) -> Result<(), CB::Error>
pub fn ignore(&mut self, pid: PeerId)
pub fn accept<CB: Callback<A>>( &mut self, cb: &mut CB, pid: PeerId, ) -> Result<(), CB::Error>
pub fn reject<CB: Callback<A>>( &mut self, cb: &mut CB, pid: PeerId, reason: &[u8], ) -> Result<(), CB::Error>
pub fn tick<'a, CB: Callback<A>>( &'a mut self, cb: &'a mut CB, ) -> Tick<'_, A, CB> ⓘ
pub fn feed<'a, CB, B, W>( &mut self, cb: &mut CB, warn: &mut W, addr: A, data: &'a [u8], buf: B, ) -> (ReceivePacket<'a, A>, Result<(), CB::Error>)
Auto Trait Implementations§
impl<A> Freeze for Net<A>
impl<A> RefUnwindSafe for Net<A>where
A: RefUnwindSafe,
impl<A> Send for Net<A>where
A: Send,
impl<A> Sync for Net<A>where
A: Sync,
impl<A> Unpin for Net<A>where
A: Unpin,
impl<A> UnwindSafe for Net<A>where
A: UnwindSafe,
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