Struct symbolic_common::ByteViewHandle [] [src]

pub struct ByteViewHandle<'bytes, T> { /* fields omitted */ }

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.

Methods

impl<'bytes, T> ByteViewHandle<'bytes, T>
[src]

[src]

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.

[src]

Constructs a ByteViewHandle from a byte slice

[src]

Constructs a ByteViewHandle from a vector of bytes

[src]

Constructs a ByteViewHandle from a file path

[src]

Constructs a ByteViewHandle from a file path

[src]

Returns the underlying storage (byte slice)

Trait Implementations

impl<'bytes, T> Deref for ByteViewHandle<'bytes, T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<'bytes, T> AsRef<T> for ByteViewHandle<'bytes, T>
[src]

[src]

Performs the conversion.