Struct rustls::internal::msgs::fragmenter::MessageFragmenter
source · pub struct MessageFragmenter { /* private fields */ }
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.