Struct divbuf::DivBufShared[][src]

pub struct DivBufShared { /* fields omitted */ }

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 DivBufs or DivBufMuts to access the storage.

Methods

impl DivBufShared
[src]

Returns the number of bytes the buffer can hold without reallocating.

Returns true if the DivBufShared has length 0

Returns the number of bytes contained in this buffer.

Try to create a read-only DivBuf that refers to the entirety of this buffer. Will fail if there are any DivBufMut objects referring to this buffer.

Examples

let dbs = DivBufShared::with_capacity(4096);
let db = dbs.try().unwrap();

Try to create a mutable DivBufMt that refers to the entirety of this buffer. Will fail if there are any DivBufMut or DivBuf objects referring to this buffer.

Examples

let dbs = DivBufShared::with_capacity(4096);
let dbm = dbs.try_mut().unwrap();

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

impl Debug for DivBufShared
[src]

Formats the value using the given formatter. Read more

impl Drop for DivBufShared
[src]

Executes the destructor for this type. Read more

impl<'a> From<&'a [u8]> for DivBufShared
[src]

Performs the conversion.

impl From<Vec<u8>> for DivBufShared
[src]

Performs the conversion.

impl Send for DivBufShared
[src]

impl Sync for DivBufShared
[src]