#[repr(C)]pub struct HurrayItemNode {
pub kind: u8,
pub name: *const u8,
pub name_len: usize,
pub tensor: *mut HurrayTensor,
pub member_count: u32,
}Expand description
One node of an item, as a C caller sees 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.
Every pointer in it borrows from the HurrayItem it came from and is valid
until hurray_item_destroy. In particular tensor MUST NOT be passed to
hurray_tensor_destroy — the item owns it.
Fields§
§kind: u8§name: *const u8First byte of the node’s name, or null when it has none.
A file names every tensor, heads and members alike, because each gets its own footer-index entry. A stream names none: the names are not on the wire, so there is nothing to borrow and this is null.
name_len: usizeByte length of name; 0 when name is null. UTF-8, not NUL-terminated.
tensor: *mut HurrayTensorThe node’s tensor handle, borrowed: its descriptor and its buffers.
A composite head is the buffer-less tensor it is on the wire, so this is non-null for every node and its buffer list is empty for a head.
member_count: u32How many of the nodes following this one are its direct members. 0 for a tensor.
Trait Implementations§
Source§impl Clone for HurrayItemNode
impl Clone for HurrayItemNode
Source§fn clone(&self) -> HurrayItemNode
fn clone(&self) -> HurrayItemNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more