pub struct DataStore { /* private fields */ }Expand description
Centralized data storage using arenas
Implementations§
Source§impl DataStore
impl DataStore
pub fn new() -> Self
Sourcepub fn store_values_batch<I>(&mut self, values: I) -> Vec<ValueRef>where
I: IntoIterator<Item = LiteralValue>,
pub fn store_values_batch<I>(&mut self, values: I) -> Vec<ValueRef>where
I: IntoIterator<Item = LiteralValue>,
Batch store literal values; returns ValueRefs in same order.
Sourcepub fn store_asts_batch<'a, I>(
&mut self,
asts: I,
sheet_registry: &SheetRegistry,
) -> Vec<AstNodeId>where
I: IntoIterator<Item = &'a ASTNode>,
pub fn store_asts_batch<'a, I>(
&mut self,
asts: I,
sheet_registry: &SheetRegistry,
) -> Vec<AstNodeId>where
I: IntoIterator<Item = &'a ASTNode>,
Batch store ASTs; returns AstNodeIds in same order.
pub fn with_capacity(estimated_cells: usize) -> Self
Sourcepub fn store_value(&mut self, value: LiteralValue) -> ValueRef
pub fn store_value(&mut self, value: LiteralValue) -> ValueRef
Store a LiteralValue and return a ValueRef
Sourcepub fn retrieve_value(&self, value_ref: ValueRef) -> LiteralValue
pub fn retrieve_value(&self, value_ref: ValueRef) -> LiteralValue
Retrieve a LiteralValue from a ValueRef
Sourcepub fn store_ast(
&mut self,
ast: &ASTNode,
sheet_registry: &SheetRegistry,
) -> AstNodeId
pub fn store_ast( &mut self, ast: &ASTNode, sheet_registry: &SheetRegistry, ) -> AstNodeId
Store an AST node and return its ID
Sourcepub fn retrieve_ast(
&self,
id: AstNodeId,
sheet_registry: &SheetRegistry,
) -> Option<ASTNode>
pub fn retrieve_ast( &self, id: AstNodeId, sheet_registry: &SheetRegistry, ) -> Option<ASTNode>
Retrieve an AST node from its ID
pub fn resolve_ast_string(&self, id: StringId) -> &str
pub fn reconstruct_reference_type_for_eval( &self, ref_type: &CompactRefType, sheet_registry: &SheetRegistry, ) -> ReferenceType
pub fn get_node(&self, id: AstNodeId) -> Option<&AstNodeData>
pub fn get_args(&self, id: AstNodeId) -> Option<&[AstNodeId]>
pub fn get_array_elems(&self, id: AstNodeId) -> Option<(u16, u16, &[AstNodeId])>
Sourcepub fn memory_usage(&self) -> DataStoreStats
pub fn memory_usage(&self) -> DataStoreStats
Get memory usage statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataStore
impl RefUnwindSafe for DataStore
impl Send for DataStore
impl Sync for DataStore
impl Unpin for DataStore
impl UnsafeUnpin for DataStore
impl UnwindSafe for DataStore
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> 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 more