pub struct ResetBuffer { /* private fields */ }Expand description
An implementation of ResetResource<Vec<u8>>.
ResetBuffer resets a Vec<u8> by either clearing it without reducing its capacity, or by
resetting it to a new zero-capacity Vec<u8> if its capacity exceeds a chosen maximum
capacity.
Implementations§
Source§impl ResetBuffer
impl ResetBuffer
Sourcepub const fn new(max_buffer_capacity: usize) -> Self
pub const fn new(max_buffer_capacity: usize) -> Self
Get an implementation of ResetResource<Vec<u8>>.
The created ResetBuffer resets a Vec<u8> by either clearing it without reducing its
capacity, or by resetting it to a new zero-capacity Vec<u8> if its capacity exceeds
max_buffer_capacity.
Trait Implementations§
Source§impl Clone for ResetBuffer
impl Clone for ResetBuffer
Source§fn clone(&self) -> ResetBuffer
fn clone(&self) -> ResetBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResetBuffer
impl Debug for ResetBuffer
Source§impl<S: Speed> DeepClone<S> for ResetBuffer
Available on crate feature clone-behavior only.
impl<S: Speed> DeepClone<S> for ResetBuffer
Available on crate feature
clone-behavior only.Source§fn deep_clone(&self) -> Self
fn deep_clone(&self) -> Self
Get a deep clone of a value, which does not share any semantically-important mutable state. Read more
Source§fn fast_deep_clone(&self) -> Selfwhere
S: FastSpeed,
fn fast_deep_clone(&self) -> Selfwhere
S: FastSpeed,
Get a deep clone of a value, which does not share any semantically-important mutable state. Read more
Source§impl<S: Speed> MirroredClone<S> for ResetBuffer
Available on crate feature clone-behavior only.
impl<S: Speed> MirroredClone<S> for ResetBuffer
Available on crate feature
clone-behavior only.Source§fn mirrored_clone(&self) -> Self
fn mirrored_clone(&self) -> Self
Get a clone that shares all semantically-important mutable state with its source. Read more
Source§fn fast_mirrored_clone(&self) -> Selfwhere
S: FastSpeed,
fn fast_mirrored_clone(&self) -> Selfwhere
S: FastSpeed,
Get a clone that shares all semantically-important mutable state with its source. Read more
Source§impl ResetResource<Vec<u8>> for ResetBuffer
impl ResetResource<Vec<u8>> for ResetBuffer
impl Copy for ResetBuffer
Auto Trait Implementations§
impl Freeze for ResetBuffer
impl RefUnwindSafe for ResetBuffer
impl Send for ResetBuffer
impl Sync for ResetBuffer
impl Unpin for ResetBuffer
impl UnwindSafe for ResetBuffer
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