pub(super) struct Decoder {
decompress: Decompress,
partial_data: Option<(u32, usize, bool)>,
}Expand description
Reads the frames of one direction of a connection.
Fields§
§decompress: Decompress§partial_data: Option<(u32, usize, bool)>The data frame which is handed out in parts: its stream, the bytes still to read and its FIN flag.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub(super) async fn read<R>(&mut self, reader: &mut R) -> Result<Option<Frame>>where
R: AsyncRead + Unpin,
pub(super) async fn read<R>(&mut self, reader: &mut R) -> Result<Option<Frame>>where
R: AsyncRead + Unpin,
Read the next frame, None if the connection ended in between frames.
A data frame larger than DATA_CHUNK_LEN comes as several ones of
the same stream, only the last one with its FIN flag.
Sourceasync fn read_data<R>(
&mut self,
reader: &mut R,
stream_id: u32,
remaining: usize,
fin: bool,
) -> Result<Frame>where
R: AsyncRead + Unpin,
async fn read_data<R>(
&mut self,
reader: &mut R,
stream_id: u32,
remaining: usize,
fin: bool,
) -> Result<Frame>where
R: AsyncRead + Unpin,
Read a data frame, or the next part of a large one.
Sourcefn decode(
&mut self,
header: [u8; 8],
flags: u8,
payload: Bytes,
) -> Result<Frame>
fn decode( &mut self, header: [u8; 8], flags: u8, payload: Bytes, ) -> Result<Frame>
Decode a control frame from its header and complete payload.
Sourcefn header_block(&mut self, input: &[u8]) -> Result<Headers>
fn header_block(&mut self, input: &[u8]) -> Result<Headers>
Decompress and parse a header block.
fn parse_header_block(block: &[u8]) -> Result<Headers>
Trait Implementations§
Auto Trait Implementations§
impl !UnwindSafe for Decoder
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].