pub struct Stream<Data> {
pub stream_id: VarInt,
pub offset: VarInt,
pub is_last_frame: bool,
pub is_fin: bool,
pub data: Data,
}Fields§
§stream_id: VarIntA variable-length integer indicating the stream ID of the stream
offset: VarIntA variable-length integer specifying the byte offset in the stream for the data in this STREAM frame.
is_last_frame: boolIf true, the frame is the last frame in the payload
is_fin: boolIf true, the frame marks the end of the stream.
data: DataThe bytes from the designated stream to be delivered.
Implementations§
Trait Implementations§
Source§impl<Data> AckElicitable for Stream<Data>
impl<Data> AckElicitable for Stream<Data>
fn ack_elicitation(&self) -> AckElicitation
Source§impl<Data> CongestionControlled for Stream<Data>
impl<Data> CongestionControlled for Stream<Data>
fn is_congestion_controlled(&self) -> bool
Source§impl<'a, Data: DecoderValue<'a>> DecoderParameterizedValue<'a> for Stream<Data>
impl<'a, Data: DecoderValue<'a>> DecoderParameterizedValue<'a> for Stream<Data>
type Parameter = u8
fn decode_parameterized( tag: Self::Parameter, buffer: DecoderBuffer<'a>, ) -> DecoderBufferResult<'a, Self>
Source§impl<'a, Data: DecoderValueMut<'a>> DecoderParameterizedValueMut<'a> for Stream<Data>
impl<'a, Data: DecoderValueMut<'a>> DecoderParameterizedValueMut<'a> for Stream<Data>
type Parameter = u8
fn decode_parameterized_mut( tag: Self::Parameter, buffer: DecoderBufferMut<'a>, ) -> DecoderBufferMutResult<'a, Self>
Source§impl<Data: EncoderValue> EncoderValue for Stream<Data>
impl<Data: EncoderValue> EncoderValue for Stream<Data>
Source§fn encoding_size_for_encoder<E: Encoder>(&self, encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, encoder: &E) -> usize
We hand optimize this encoding size so we can quickly estimate how large a STREAM frame will be
Source§fn encode_mut<E>(&mut self, encoder: &mut E)where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E)where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
Source§fn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
Source§fn encode_with_len_prefix<Len, E>(&self, encoder: &mut E)
fn encode_with_len_prefix<Len, E>(&self, encoder: &mut E)
Encodes the value into the encoder with a prefix of
Lenfn encode_to_vec(&self) -> Vec<u8> ⓘ
Source§impl<'a> From<Stream<DecoderBuffer<'a>>> for StreamRef<'a>
impl<'a> From<Stream<DecoderBuffer<'a>>> for StreamRef<'a>
Source§fn from(s: Stream<DecoderBuffer<'a>>) -> Self
fn from(s: Stream<DecoderBuffer<'a>>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<Stream<DecoderBufferMut<'a>>> for StreamRef<'a>
impl<'a> From<Stream<DecoderBufferMut<'a>>> for StreamRef<'a>
Source§fn from(s: Stream<DecoderBufferMut<'a>>) -> Self
fn from(s: Stream<DecoderBufferMut<'a>>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<Stream<DecoderBufferMut<'a>>> for StreamMut<'a>
impl<'a> From<Stream<DecoderBufferMut<'a>>> for StreamMut<'a>
Source§fn from(s: Stream<DecoderBufferMut<'a>>) -> Self
fn from(s: Stream<DecoderBufferMut<'a>>) -> Self
Converts to this type from the input type.
Source§impl<Data> IntoEvent<Frame> for &Stream<Data>where
Data: EncoderValue,
impl<Data> IntoEvent<Frame> for &Stream<Data>where
Data: EncoderValue,
fn into_event(self) -> Frame
impl<Data: Eq> Eq for Stream<Data>
impl<Data> StructuralPartialEq for Stream<Data>
Auto Trait Implementations§
impl<Data> Freeze for Stream<Data>where
Data: Freeze,
impl<Data> RefUnwindSafe for Stream<Data>where
Data: RefUnwindSafe,
impl<Data> Send for Stream<Data>where
Data: Send,
impl<Data> Sync for Stream<Data>where
Data: Sync,
impl<Data> Unpin for Stream<Data>where
Data: Unpin,
impl<Data> UnwindSafe for Stream<Data>where
Data: 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
Source§impl<T> PacketPayloadEncoder for Twhere
T: EncoderValue,
impl<T> PacketPayloadEncoder for Twhere
T: EncoderValue,
Source§fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usizewhere
E: Encoder,
fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usizewhere
E: Encoder,
Returns an estimate of the encoding size of the payload. This
may be inaccurate from what actually is encoded. Estimates should
be less than or equal to what is actually written.
Implementations can return 0 to skip encoding.