Struct ownedbytes::OwnedBytes[][src]

pub struct OwnedBytes { /* fields omitted */ }
Expand description

An OwnedBytes simply wraps an object that owns a slice of data and exposes this data as a static slice.

The backing object is required to be StableDeref.

Implementations

Creates an empty OwnedBytes.

Creates an OwnedBytes intance given a StableDeref object.

creates a fileslice that is just a view over a slice of the data.

Returns the underlying slice of data. Deref and AsRef are also available.

Returns the len of the slice.

Splits the OwnedBytes into two OwnedBytes (left, right).

Left will hold split_len bytes.

This operation is cheap and does not require to copy any memory. On the other hand, both left and right retain a handle over the entire slice of memory. In other words, the memory will only be released when both left and right are dropped.

Splits the right part of the OwnedBytes at the given offset.

self is truncated to split_len, left with the remaining bytes.

Returns true iff this OwnedBytes is empty.

Drops the left most advance_len bytes.

See also .clip(clip_len: usize)).

Reads an u8 from the OwnedBytes and advance by one byte.

Reads an u64 encoded as little-endian from the OwnedBytes and advance by 8 bytes.

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Like read, except that it reads into a slice of buffers. Read more

🔬 This is a nightly-only experimental API. (can_vector)

Determines if this Reader has an efficient read_vectored implementation. Read more

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, appending them to buf. Read more

Creates a “by reference” adapter for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

Creates an adapter which will chain this stream with another. Read more

Creates an adapter which will read at most limit bytes from it. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.