pub struct FrameCodec<R, W> {
pub reader: FrameReader<R>,
pub writer: FrameWriter<W>,
}Expand description
Combined async frame reader + writer over a split stream.
Fields§
§reader: FrameReader<R>§writer: FrameWriter<W>Implementations§
Source§impl<R: AsyncRead + Unpin, W: AsyncWrite + Unpin> FrameCodec<R, W>
impl<R: AsyncRead + Unpin, W: AsyncWrite + Unpin> FrameCodec<R, W>
Sourcepub async fn read_frame(&mut self) -> Result<Option<Frame>, TransportError>
pub async fn read_frame(&mut self) -> Result<Option<Frame>, TransportError>
Read the next frame.
Sourcepub async fn write_frame(&mut self, frame: &Frame) -> Result<(), TransportError>
pub async fn write_frame(&mut self, frame: &Frame) -> Result<(), TransportError>
Write a frame.
Trait Implementations§
Auto Trait Implementations§
impl<R, W> Freeze for FrameCodec<R, W>
impl<R, W> RefUnwindSafe for FrameCodec<R, W>where
R: RefUnwindSafe,
W: RefUnwindSafe,
impl<R, W> Send for FrameCodec<R, W>
impl<R, W> Sync for FrameCodec<R, W>
impl<R, W> Unpin for FrameCodec<R, W>
impl<R, W> UnsafeUnpin for FrameCodec<R, W>where
R: UnsafeUnpin,
W: UnsafeUnpin,
impl<R, W> UnwindSafe for FrameCodec<R, W>where
R: UnwindSafe,
W: 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