pub struct ByteViewHandle<'bytes, T> { /* private fields */ }
Expand description

A smart pointer for byte data that owns a derived object.

In some situations symbolic needs to deal with types that are based on potentially owned or borrowed bytes and wants to provide another view at them. This for instance is used when symbolic works with partially parsed files (like headers) of byte data.

Upon deref the inner type is returned. Additionally the bytes are exposed through the static get_bytes method.

Implementations§

Creates a new ByteViewHandle from a ByteView.

The closure is invoked with the borrowed bytes from the original byte view and the return value is retained in the handle.

Constructs a ByteViewHandle from a byte slice.

Constructs a ByteViewHandle from a vector of bytes.

Constructs a ByteViewHandle from a file path.

Constructs a ByteViewHandle from a file path.

Returns the underlying storage (byte slice).

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
The resulting type after dereferencing.
Dereferences the value.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.