pub struct CompressedNode { /* private fields */ }Expand description
A node in the hyperbolic tensor network.
Stores exact metadata and raw value bytes. Despite the historical name, no compression is performed — the name is retained for API stability and will be revisited before a 1.0 release.
Implementations§
Source§impl CompressedNode
impl CompressedNode
Sourcepub fn new(metadata: NodeMetadata, value: Vec<u8>) -> Self
pub fn new(metadata: NodeMetadata, value: Vec<u8>) -> Self
Create a new node.
Sourcepub fn metadata(&self) -> &NodeMetadata
pub fn metadata(&self) -> &NodeMetadata
Get the node metadata.
Sourcepub fn metadata_mut(&mut self) -> &mut NodeMetadata
pub fn metadata_mut(&mut self) -> &mut NodeMetadata
Get a mutable reference to the metadata.
Sourcepub fn update_value(&mut self, value: Vec<u8>)
pub fn update_value(&mut self, value: Vec<u8>)
Update the value bytes.
Sourcepub fn add_child(&mut self, signature: GeometricSignature)
pub fn add_child(&mut self, signature: GeometricSignature)
Add a child node reference.
Sourcepub fn remove_child(&mut self, unique_id: &str)
pub fn remove_child(&mut self, unique_id: &str)
Remove a child reference by unique id (used when the child is deleted).
Sourcepub fn children(&self) -> &[GeometricSignature]
pub fn children(&self) -> &[GeometricSignature]
Get the child node references.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Check if this node has any children.
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
Get the number of children.
Sourcepub fn semantic_coords(&self) -> &[u8] ⓘ
pub fn semantic_coords(&self) -> &[u8] ⓘ
Get the semantic coordinates (raw Q64.64 bytes, 16 bytes per dimension).
Sourcepub fn set_semantic_coords(&mut self, coords: Vec<u8>)
pub fn set_semantic_coords(&mut self, coords: Vec<u8>)
Set the semantic coordinates (raw Q64.64 bytes).
Trait Implementations§
Source§impl Clone for CompressedNode
impl Clone for CompressedNode
Source§fn clone(&self) -> CompressedNode
fn clone(&self) -> CompressedNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompressedNode
impl RefUnwindSafe for CompressedNode
impl Send for CompressedNode
impl Sync for CompressedNode
impl Unpin for CompressedNode
impl UnsafeUnpin for CompressedNode
impl UnwindSafe for CompressedNode
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