pub struct Array<T: ArrayElement>(/* private fields */);Expand description
A flat array of T values in native byte order.
The blob encoding ID is derived from describing the schema — including
T::id() as metadata::blob_encoding — so Array<u8> and Array<f32>
get distinct ids without needing compile-time hashing.
Shape metadata lives in TribleSpace triples, not in the blob.
Use View<[T::Native]> for zero-copy access via TryFromBlob.
Trait Implementations§
Source§impl<T: ArrayElement> BlobEncoding for Array<T>
impl<T: ArrayElement> BlobEncoding for Array<T>
Source§fn blob_from<T: IntoBlob<Self>>(t: T) -> Blob<Self>
fn blob_from<T: IntoBlob<Self>>(t: T) -> Blob<Self>
Converts a concrete Rust type to a blob with this schema via
IntoBlob.Source§fn to_encoded(blob: Blob<Self>) -> Encoded<Handle<Self>>where
Handle<Self>: InlineEncoding,
fn to_encoded(blob: Blob<Self>) -> Encoded<Handle<Self>>where
Handle<Self>: InlineEncoding,
Lift a
Blob<Self> into the Encoded
sum entity!{} consumes — yields
Encoded::Blob(blob.transmute()). The handle lives inside the
blob; consumers recover it via
Encoded::inline. Read moreSource§impl<T: ArrayElement> Encodes<Vec<<T as ArrayElement>::Native>> for Array<T>
Store a Vec<T::Native> as an Array<T> blob (zero-copy via ByteSource).
impl<T: ArrayElement> Encodes<Vec<<T as ArrayElement>::Native>> for Array<T>
Store a Vec<T::Native> as an Array<T> blob (zero-copy via ByteSource).
Source§impl<T: ArrayElement> MetaDescribe for Array<T>
impl<T: ArrayElement> MetaDescribe for Array<T>
Source§fn id() -> Id
fn id() -> Id
Returns the id of this type. Default: derive from
Self::describe().root(). Impls choose whether the id is
explicit (an entity!{ &id_hex @ … } form inside describe)
or derived (no @, intrinsic id from the facts) — either
way the default reads the root the fragment carries. Read moreSource§impl<T: ArrayElement> TryFromBlob<Array<T>> for Bytes
Retrieve raw bytes from an Array blob.
impl<T: ArrayElement> TryFromBlob<Array<T>> for Bytes
Retrieve raw bytes from an Array blob.
Source§impl<T: ArrayElement> TryFromBlob<Array<T>> for View<[T::Native]>
Zero-copy typed view directly from an Array blob.
impl<T: ArrayElement> TryFromBlob<Array<T>> for View<[T::Native]>
Zero-copy typed view directly from an Array blob.
ⓘ
let floats: View<[f32]> = blobs.get(handle)?;Auto Trait Implementations§
impl<T> Freeze for Array<T>
impl<T> RefUnwindSafe for Array<T>where
T: RefUnwindSafe,
impl<T> Send for Array<T>where
T: Send,
impl<T> Sync for Array<T>where
T: Sync,
impl<T> Unpin for Array<T>where
T: Unpin,
impl<T> UnsafeUnpin for Array<T>
impl<T> UnwindSafe for Array<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Encodes<&Inline<Handle<T>>> for T
impl<T> Encodes<&Inline<Handle<T>>> for T
Source§impl<S> Encodes<Blob<S>> for S
impl<S> Encodes<Blob<S>> for S
Source§impl<T> Encodes<Inline<Handle<T>>> for T
impl<T> Encodes<Inline<Handle<T>>> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
Source§fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
Run the conversion.