Trait s2n_quic_core::transmission::writer::Writer
source · pub trait Writer {
Show 13 methods
// Required methods
fn current_time(&self) -> Timestamp;
fn transmission_constraint(&self) -> Constraint;
fn transmission_mode(&self) -> Mode;
fn remaining_capacity(&self) -> usize;
fn write_frame<Frame>(&mut self, frame: &Frame) -> Option<PacketNumber>
where Frame: EncoderValue + FrameTrait,
for<'frame> &'frame Frame: IntoEvent<Frame>;
fn write_fitted_frame<Frame>(&mut self, frame: &Frame) -> PacketNumber
where Frame: EncoderValue + FrameTrait,
for<'frame> &'frame Frame: IntoEvent<Frame>;
fn write_frame_forced<Frame>(
&mut self,
frame: &Frame
) -> Option<PacketNumber>
where Frame: EncoderValue + FrameTrait,
for<'frame> &'frame Frame: IntoEvent<Frame>;
fn ack_elicitation(&self) -> AckElicitation;
fn packet_number(&self) -> PacketNumber;
fn local_endpoint_type(&self) -> Type;
fn header_len(&self) -> usize;
fn tag_len(&self) -> usize;
// Provided method
fn write_ack_frame<AckRanges: AckRangesTrait>(
&mut self,
ack_frame: &Ack<AckRanges>
) -> Option<PacketNumber> { ... }
}
Expand description
Context information that is passed to on_transmit
calls on Streams
Required Methods§
sourcefn current_time(&self) -> Timestamp
fn current_time(&self) -> Timestamp
Returns the current point of time
sourcefn transmission_constraint(&self) -> Constraint
fn transmission_constraint(&self) -> Constraint
Returns the transmission constraint for the current packet
sourcefn transmission_mode(&self) -> Mode
fn transmission_mode(&self) -> Mode
Returns the transmission mode for the current packet
sourcefn remaining_capacity(&self) -> usize
fn remaining_capacity(&self) -> usize
Returns the number of available bytes remaining in the current payload
sourcefn write_frame<Frame>(&mut self, frame: &Frame) -> Option<PacketNumber>
fn write_frame<Frame>(&mut self, frame: &Frame) -> Option<PacketNumber>
Attempt to write a frame.
If this was successful the number of the packet that will be used to send the frame will be returned.
sourcefn write_fitted_frame<Frame>(&mut self, frame: &Frame) -> PacketNumber
fn write_fitted_frame<Frame>(&mut self, frame: &Frame) -> PacketNumber
Writes a pre-fitted frame.
Callers should ensure the frame fits within the outgoing buffer when using this function. The context should panic if otherwise.
sourcefn write_frame_forced<Frame>(&mut self, frame: &Frame) -> Option<PacketNumber>
fn write_frame_forced<Frame>(&mut self, frame: &Frame) -> Option<PacketNumber>
Attempt to write a frame, bypassing congestion controller constraint checks. If this was successful the number of the packet that will be used to send the frame will be returned.
sourcefn ack_elicitation(&self) -> AckElicitation
fn ack_elicitation(&self) -> AckElicitation
Returns the ack elicitation of the current packet
sourcefn packet_number(&self) -> PacketNumber
fn packet_number(&self) -> PacketNumber
Returns the packet number for the current packet
sourcefn local_endpoint_type(&self) -> Type
fn local_endpoint_type(&self) -> Type
Returns the local endpoint type (client or server)
sourcefn header_len(&self) -> usize
fn header_len(&self) -> usize
Returns the length of the packet header in bytes
Provided Methods§
sourcefn write_ack_frame<AckRanges: AckRangesTrait>(
&mut self,
ack_frame: &Ack<AckRanges>
) -> Option<PacketNumber>
fn write_ack_frame<AckRanges: AckRangesTrait>( &mut self, ack_frame: &Ack<AckRanges> ) -> Option<PacketNumber>
Attempt to write an ack frame.
If this was successful the number of the packet that will be used to send the frame will be returned.