pub struct Attributes { /* private fields */ }Expand description
The attribute relationships of every concept.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn rows_size_in_bytes(&self) -> usize
pub fn rows_size_in_bytes(&self) -> usize
The heap bytes the rows hold (crate::footprint).
Sourcepub fn inverted_size_in_bytes(&self) -> usize
pub fn inverted_size_in_bytes(&self) -> usize
The heap bytes the inverted index holds.
It is derived when the artifact opens rather than read from it, so it is reported apart from the rows it was derived from.
Sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
The heap bytes the rows and the inverted index hold together.
Sourcepub fn build(
nodes: u32,
types: Vec<u64>,
edges: Vec<Edge>,
) -> Result<Self, AttributesError>
pub fn build( nodes: u32, types: Vec<u64>, edges: Vec<Edge>, ) -> Result<Self, AttributesError>
Builds the attributes of nodes concepts from edges, whose types
index types.
§Errors
Returns AttributesError::OutOfRange for a row beyond nodes or
beyond the type list, and AttributesError::TooMany past u32.
Sourcepub fn rows(&self, source: Ordinal) -> impl Iterator<Item = Row<'_>> + '_
pub fn rows(&self, source: Ordinal) -> impl Iterator<Item = Row<'_>> + '_
The rows of source, sorted by group, then type, then value.
Sourcepub fn sources(&self, kind: u32, target: Ordinal) -> &[u32]
pub fn sources(&self, kind: u32, target: Ordinal) -> &[u32]
The sources with a relationship of type kind to target, sorted.
Sourcepub fn sources_of_kind(&self, kind: u32) -> Option<&RoaringBitmap>
pub fn sources_of_kind(&self, kind: u32) -> Option<&RoaringBitmap>
Every source with a relationship of type kind, whatever its value.
Sourcepub fn targets_of_kind(&self, kind: u32) -> &[u32]
pub fn targets_of_kind(&self, kind: u32) -> &[u32]
The destination concepts of type kind, sorted.
Sourcepub fn read_from(input: &mut impl Read) -> Result<Self, AttributesError>
pub fn read_from(input: &mut impl Read) -> Result<Self, AttributesError>
Reads the layout and derives the inverted index.
§Errors
Returns AttributesError for a truncated, inconsistent, or foreign
artifact.