Trait SparsePointer

Source
pub trait SparsePointer<S: DeserializeOwned + Serialize + SparsableTrait> {
    // Required methods
    fn get(&self) -> Result<SparseValue<'_, S>, SparseError>;
    fn get_mut(
        &mut self,
        state_cell: Rc<RefCell<SparseState>>,
    ) -> Result<SparseValueMut<'_, S>, SparseError>;
    fn check_version(&self, state: &SparseState) -> Result<(), SparseError>;
    fn self_reset(
        &mut self,
        state: &mut SparseState,
        metadata: &SparseMetadata,
        depth: u32,
    ) -> Result<(), SparseError>;
}
Expand description

§Base shared by owned pointers

Required Methods§

Source

fn get(&self) -> Result<SparseValue<'_, S>, SparseError>

Get the inner value of the pointer

Source

fn get_mut( &mut self, state_cell: Rc<RefCell<SparseState>>, ) -> Result<SparseValueMut<'_, S>, SparseError>

Get the inner value of the pointer (mutable)

Source

fn check_version(&self, state: &SparseState) -> Result<(), SparseError>

Check if the inner value is outdated

Source

fn self_reset( &mut self, state: &mut SparseState, metadata: &SparseMetadata, depth: u32, ) -> Result<(), SparseError>

Reset the inner value and parse it again from the state

Implementors§