pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
pub fn new() -> Connection
pub fn new_accept_token<CB: Callback>(cb: &mut CB, token: Token) -> Connection
pub fn reset(&mut self)
pub fn is_unconnected(&self) -> bool
pub fn needs_tick(&self) -> Timeout
pub fn connect<CB: Callback>(&mut self, cb: &mut CB) -> Result<(), CB::Error>
pub fn disconnect<CB: Callback>( &mut self, cb: &mut CB, reason: &[u8], ) -> Result<(), CB::Error>
pub fn flush<CB: Callback>(&mut self, cb: &mut CB) -> Result<(), CB::Error>
pub fn send<CB: Callback>( &mut self, cb: &mut CB, buffer: &[u8], vital: bool, ) -> Result<(), Error<CB::Error>>
pub fn send_connless<CB: Callback>( &mut self, cb: &mut CB, data: &[u8], ) -> Result<(), Error<CB::Error>>
pub fn tick<CB: Callback>(&mut self, cb: &mut CB) -> Result<(), CB::Error>
Sourcepub fn feed<'a, B, CB, W>(
&mut self,
cb: &mut CB,
warn: &mut W,
data: &'a [u8],
buf: B,
) -> (ReceivePacket<'a>, Result<(), CB::Error>)
pub fn feed<'a, B, CB, W>( &mut self, cb: &mut CB, warn: &mut W, data: &'a [u8], buf: B, ) -> (ReceivePacket<'a>, Result<(), CB::Error>)
Notifies the connection of incoming data.
buffer must have at least size MAX_PAYLOAD.
pub fn feed_impl<'d, 's, CB, W>( &mut self, cb: &mut CB, warn: &mut W, data: &'d [u8], buffer: BufferRef<'d, 's>, ) -> (ReceivePacket<'d>, Result<(), CB::Error>)
Auto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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