pub struct Connection<In, Out> { /* private fields */ }Implementations§
Source§impl<In: DeserializeOwned + Send, Out: Serialize + Send> Connection<In, Out>
impl<In: DeserializeOwned + Send, Out: Serialize + Send> Connection<In, Out>
pub fn new(stream: TcpStream) -> Self
pub async fn start(&'static self)
pub async fn handle_read(&self, reader: OwnedReadHalf) -> Result<()>
pub async fn on_receive( &'static self, action: impl FnMut(In) + Send + 'static, ) -> &'static Self
pub async fn send(&'static self, msg: impl Into<Out>) -> Result<()>
Auto Trait Implementations§
impl<In, Out> !Freeze for Connection<In, Out>
impl<In, Out> !RefUnwindSafe for Connection<In, Out>
impl<In, Out> Send for Connection<In, Out>where
Out: Send,
impl<In, Out> Sync for Connection<In, Out>where
Out: Send,
impl<In, Out> Unpin for Connection<In, Out>where
Out: Unpin,
impl<In, Out> !UnwindSafe for Connection<In, Out>
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