pub struct Settings(/* private fields */);Expand description
Collection of settings for an HTTP3 connection.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn builder() -> SettingsBuilder
pub fn builder() -> SettingsBuilder
Produces a new SettingsBuilder for new Settings construction.
Sourcepub fn with_frame(frame: &Frame<'_>) -> Result<Self, ErrorCode>
pub fn with_frame(frame: &Frame<'_>) -> Result<Self, ErrorCode>
Constructs Settings parsing payload of a Frame.
Returns an Err in case of invalid setting or incomplete payload.
Unknown settings-ids are ignored.
§Panics
Panics if frame is not type FrameKind::Settings.
Sourcepub fn generate_frame(&self) -> Frame<'_>
pub fn generate_frame(&self) -> Frame<'_>
Generates a Frame with these settings.
This function allocates heap-memory, producing a Frame with owned payload.
See Self::generate_frame_ref for a version without inner memory allocation.
Sourcepub fn generate_frame_ref<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<Frame<'a>, EndOfBuffer>
pub fn generate_frame_ref<'a>( &self, buffer: &'a mut [u8], ) -> Result<Frame<'a>, EndOfBuffer>
Generates a Frame with these settings.
This function does not allocates memory. It uses buffer for frame-payload
serialization.
See Self::generate_frame for a version with inner memory allocation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
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