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§
Sourcefn get(&self) -> Result<SparseValue<'_, S>, SparseError>
fn get(&self) -> Result<SparseValue<'_, S>, SparseError>
Get the inner value of the pointer
Sourcefn get_mut(
&mut self,
state_cell: Rc<RefCell<SparseState>>,
) -> Result<SparseValueMut<'_, S>, SparseError>
fn get_mut( &mut self, state_cell: Rc<RefCell<SparseState>>, ) -> Result<SparseValueMut<'_, S>, SparseError>
Get the inner value of the pointer (mutable)
Sourcefn check_version(&self, state: &SparseState) -> Result<(), SparseError>
fn check_version(&self, state: &SparseState) -> Result<(), SparseError>
Check if the inner value is outdated
Sourcefn self_reset(
&mut self,
state: &mut SparseState,
metadata: &SparseMetadata,
depth: u32,
) -> Result<(), SparseError>
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