pub struct Decoder { /* private fields */ }Expand description
Decodes frames into requests and responses.
Implementations§
Source§impl Decoder
impl Decoder
pub fn new() -> Self
Sourcepub fn extend_bytes(&mut self, data: Bytes)
pub fn extend_bytes(&mut self, data: Bytes)
Appends bytes to the internal buffer.
Sourcepub fn decode_frame(&mut self) -> Result<Option<Frame>, ProtocolError>
pub fn decode_frame(&mut self) -> Result<Option<Frame>, ProtocolError>
Attempts to decode the next frame from the buffer.
Sourcepub fn decode_request(&mut self) -> Result<Option<Request>, ProtocolError>
pub fn decode_request(&mut self) -> Result<Option<Request>, ProtocolError>
Attempts to decode the next request from the buffer.
Sourcepub fn decode_response(&mut self) -> Result<Option<Response>, ProtocolError>
pub fn decode_response(&mut self) -> Result<Option<Response>, ProtocolError>
Attempts to decode the next response from the buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
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