pub struct MessageFragmenter { /* private fields */ }Implementations§
Source§impl MessageFragmenter
 
impl MessageFragmenter
Sourcepub fn new(max_fragment_size: Option<usize>) -> Result<Self, Error>
 
pub fn new(max_fragment_size: Option<usize>) -> Result<Self, Error>
Make a new fragmenter.
max_fragment_size is 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.
Sourcepub fn fragment(&self, msg: PlainMessage, out: &mut VecDeque<PlainMessage>)
 
pub fn fragment(&self, msg: PlainMessage, out: &mut VecDeque<PlainMessage>)
Take the Message msg and re-fragment it into new
messages whose fragment is no more than max_frag.
The new messages are appended to the out deque.
Payloads are copied.
Sourcepub fn fragment_borrow<'a>(
    &self,
    typ: ContentType,
    version: ProtocolVersion,
    payload: &'a [u8],
    out: &mut VecDeque<BorrowedPlainMessage<'a>>,
)
 
pub fn fragment_borrow<'a>( &self, typ: ContentType, version: ProtocolVersion, payload: &'a [u8], out: &mut VecDeque<BorrowedPlainMessage<'a>>, )
Enqueue borrowed fragments of (version, typ, payload) which
are no longer than max_frag onto the out deque.
pub fn set_max_fragment_size(&mut self, new: Option<usize>) -> Result<(), Error>
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