Struct rustls::internal::msgs::fragmenter::MessageFragmenter
source · pub struct MessageFragmenter {
max_frag: usize,
}
Fields§
§max_frag: usize
Implementations§
source§impl MessageFragmenter
impl MessageFragmenter
sourcepub fn fragment_message<'a>(
&self,
msg: &'a PlainMessage,
) -> impl Iterator<Item = BorrowedPlainMessage<'a>> + 'a
pub fn fragment_message<'a>( &self, msg: &'a PlainMessage, ) -> impl Iterator<Item = BorrowedPlainMessage<'a>> + 'a
Take the Message msg
and re-fragment it into new
messages whose fragment is no more than max_frag.
Return an iterator across those messages.
Payloads are borrowed.
sourcepub fn fragment_slice<'a>(
&self,
typ: ContentType,
version: ProtocolVersion,
payload: &'a [u8],
) -> impl Iterator<Item = BorrowedPlainMessage<'a>> + 'a
pub fn fragment_slice<'a>( &self, typ: ContentType, version: ProtocolVersion, payload: &'a [u8], ) -> impl Iterator<Item = BorrowedPlainMessage<'a>> + 'a
Enqueue borrowed fragments of (version, typ, payload) which
are no longer than max_frag onto the out
deque.
sourcepub fn set_max_fragment_size(
&mut self,
max_fragment_size: Option<usize>,
) -> Result<(), Error>
pub fn set_max_fragment_size( &mut self, max_fragment_size: Option<usize>, ) -> Result<(), Error>
Set the maximum fragment size that will be produced.
This includes overhead. A max_fragment_size
of 10 will produce TLS fragments
up to 10 bytes long.
A max_fragment_size
of None
sets the highest allowable fragment size.
Returns BadMaxFragmentSize if the size is smaller than 32 or larger than 16389.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MessageFragmenter
impl RefUnwindSafe for MessageFragmenter
impl Send for MessageFragmenter
impl Sync for MessageFragmenter
impl Unpin for MessageFragmenter
impl UnwindSafe for MessageFragmenter
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