#[repr(C)]pub struct HurrayCompositeNode {
pub kind: u8,
pub name: *const u8,
pub name_len: usize,
pub descriptor: *const HurrayDescriptor,
pub payloads: *const HurrayIoSlice,
pub payload_count: usize,
pub member_count: u32,
}Expand description
One node of a composite to write: a tensor member, or a head whose members follow it.
A flat tagged struct rather than a union, for the reason
HurrayKvValue is one: every binding generator downstream of
this header reads a struct correctly and few read a union well. Fields the kind does
not select are ignored.
Every pointer borrows from the caller and MUST stay valid and unmodified until the write call returns. Nothing here is copied — not the descriptors, and above all not the payloads (ADR-041 § 3).
Fields§
§kind: u8§name: *const u8First byte of this node’s tensor name, UTF-8 and not NUL-terminated.
Required on the file surface, where every tensor — head and member alike — gets its own footer-index entry. Ignored on the stream surface, which carries no names.
name_len: usizeByte length of name.
descriptor: *const HurrayDescriptorThe node’s descriptor: a member’s tensor descriptor, or a head’s composite one.
payloads: *const HurrayIoSliceOne slice per buffer handle in descriptor’s buffer table, in that order.
Ignored for a composite node: a head owns no data buffers, which its descriptor already states — and a head whose descriptor says otherwise is refused by the validator, not here.
payload_count: usizeNumber of slices at payloads.
member_count: u32How many of the nodes following this one are its direct members. 0 for a tensor.
Trait Implementations§
Source§impl Clone for HurrayCompositeNode
impl Clone for HurrayCompositeNode
Source§fn clone(&self) -> HurrayCompositeNode
fn clone(&self) -> HurrayCompositeNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more