Struct divbuf::DivBufShared
source · pub struct DivBufShared { /* private fields */ }
Expand description
The “entry point” to the divbuf
crate.
A DivBufShared
owns storage, but cannot directly access it. An
application will typically create an instance of this class for every
independent buffer it wants to manage, and then create child DivBuf
s or
DivBufMut
s to access the storage.
Implementations
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of bytes the buffer can hold without reallocating.
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new, empty, DivBufShared
with a specified capacity.
After constructing a DivBufShared
this way, it can only be populated
via a child DivBufMut
.
Trait Implementations
sourcefn from(src: &'a [u8]) -> DivBufShared
fn from(src: &'a [u8]) -> DivBufShared
Converts to this type from the input type.
sourcefn from(src: Vec<u8>) -> DivBufShared
fn from(src: Vec<u8>) -> DivBufShared
Converts to this type from the input type.
Auto Trait Implementations
Blanket Implementations
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more