rlmesh::ext::Storage
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.
Associated functions
Methods
from_vec
associated function[source]fn from_vec(data: Vec<u8>) -> SelfAdopt an existing buffer without copying. No alignment guarantee.
from_slice
associated function[source]fn from_slice(data: &[u8]) -> SelfCopy data into a fresh 64-byte-aligned buffer.
zeroed
associated function[source]fn zeroed(len: usize) -> SelfAllocate 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) -> usizeLength of the backing buffer in bytes.
is_empty
method[source]fn is_empty(&self) -> boolWhether the backing buffer is empty.
ptr_eq
method[source]fn ptr_eq(&self, other: &Self) -> boolWhether two storages share the same underlying allocation.
Trait implementations
- impl Debug for Storage
- impl Clone for Storage