This reference describes unreleased code on main; no release documents it yet.

rlmesh::ext::Storage

structPreviewuse rlmesh::ext::Storage;[source]

Reference-counted, immutable byte storage shared by one or more Tensor views.

struct Storage(/* private field */)

Buffers allocated by Storage (from_slice, zeroed) are 64-byte aligned. Buffers adopted from a caller (from_vec) keep their original allocation and carry no alignment guarantee.

from_vec

associated function[source]
fn from_vec(data: Vec<u8>) -> Self

Adopt an existing buffer without copying. No alignment guarantee.

from_slice

associated function[source]
fn from_slice(data: &[u8]) -> Self

Copy data into a fresh 64-byte-aligned buffer.

zeroed

associated function[source]
fn zeroed(len: usize) -> Self

Allocate a zero-filled 64-byte-aligned buffer of len bytes.

as_slice

method[source]
fn as_slice(&self) -> &[u8]

The full backing buffer.

len

method[source]
fn len(&self) -> usize

Length of the backing buffer in bytes.

is_empty

method[source]
fn is_empty(&self) -> bool

Whether the backing buffer is empty.

ptr_eq

method[source]
fn ptr_eq(&self, other: &Self) -> bool

Whether two storages share the same underlying allocation.

Trait implementations

  • impl Debug for Storage
  • impl Clone for Storage