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 = OutboundPlainMessage<'a>> + 'a
pub fn fragment_message<'a>( &self, msg: &'a PlainMessage, ) -> impl Iterator<Item = OutboundPlainMessage<'a>> + 'a
Take msg
and fragment it into new messages with the same type and version.
Each returned message size is no more than max_frag
.
Return an iterator across those messages.
Payloads are borrowed from msg
.
Sourcepub(crate) fn fragment_payload<'a>(
&self,
typ: ContentType,
version: ProtocolVersion,
payload: OutboundChunks<'a>,
) -> impl ExactSizeIterator<Item = OutboundPlainMessage<'a>>
pub(crate) fn fragment_payload<'a>( &self, typ: ContentType, version: ProtocolVersion, payload: OutboundChunks<'a>, ) -> impl ExactSizeIterator<Item = OutboundPlainMessage<'a>>
Take payload
and fragment it into new messages with given type and version.
Each returned message size is no more than max_frag
.
Return an iterator across those messages.
Payloads are borrowed from payload
.
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