Struct rustls::internal::msgs::fragmenter::MessageFragmenter
source · [−]pub struct MessageFragmenter { /* private fields */ }
Implementations
sourceimpl 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 RefUnwindSafe for MessageFragmenter
impl Send for MessageFragmenter
impl Sync for MessageFragmenter
impl Unpin for MessageFragmenter
impl UnwindSafe for MessageFragmenter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more