Struct loco_protocol::command::codec::CommandCodec
source · [−]pub struct CommandCodec<S> { /* private fields */ }Expand description
Provide Command read / write operation to stream
Implementations
sourceimpl<S> CommandCodec<S>
impl<S> CommandCodec<S>
pub const fn new(stream: S) -> Self
pub const fn stream(&self) -> &S
pub fn stream_mut(&mut self) -> &mut S
pub fn into_inner(self) -> S
sourceimpl<S: Write> CommandCodec<S>
impl<S: Write> CommandCodec<S>
sourceimpl<S: Read> CommandCodec<S>
impl<S: Read> CommandCodec<S>
sourceimpl<S: AsyncRead + Unpin> CommandCodec<S>
impl<S: AsyncRead + Unpin> CommandCodec<S>
sourcepub async fn read_async(&mut self) -> Result<(usize, Command), StreamError>
pub async fn read_async(&mut self) -> Result<(usize, Command), StreamError>
Read one command from stream async. Returns tuple with read size and Command.
sourceimpl<S: AsyncWrite + Unpin> CommandCodec<S>
impl<S: AsyncWrite + Unpin> CommandCodec<S>
sourcepub async fn write_async(
&mut self,
command: &Command
) -> Result<usize, StreamError>
pub async fn write_async(
&mut self,
command: &Command
) -> Result<usize, StreamError>
Write command to stream async
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for CommandCodec<S>where
S: RefUnwindSafe,
impl<S> Send for CommandCodec<S>where
S: Send,
impl<S> Sync for CommandCodec<S>where
S: Sync,
impl<S> Unpin for CommandCodec<S>where
S: Unpin,
impl<S> UnwindSafe for CommandCodec<S>where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more