pub enum SparseSelector<T> {
Ref(SparseRefRaw<T>),
Obj(SparsePointedValue<T>),
Null,
}Expand description
§An owned selector between a raw object, a raw pointer or an owned pointer
Use this enum in your structure when allowing either a pointer or the value directly.
The SparseSelector allows to switch between a raw, unparsed pointer to a parsed pointer resolved at initialization.
Variants§
Ref(SparseRefRaw<T>)
A deserialized JSON pointer contained the pointed value from the local or distant file
Obj(SparsePointedValue<T>)
The object included in the original document
Null
A default value that should not be present once the SparseRoot document has been initialized.
Trait Implementations§
Source§impl<T: Clone> Clone for SparseSelector<T>
impl<T: Clone> Clone for SparseSelector<T>
Source§fn clone(&self) -> SparseSelector<T>
fn clone(&self) -> SparseSelector<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SparseSelector<T>
impl<T: Debug> Debug for SparseSelector<T>
Source§impl<T> Default for SparseSelector<T>
impl<T> Default for SparseSelector<T>
Source§impl<'de, T> Deserialize<'de> for SparseSelector<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SparseSelector<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PartialEq> PartialEq for SparseSelector<T>
impl<T: PartialEq> PartialEq for SparseSelector<T>
Source§impl<T> Serialize for SparseSelector<T>where
T: Serialize,
impl<T> Serialize for SparseSelector<T>where
T: Serialize,
Source§impl<T> Sparsable for SparseSelector<T>
impl<T> Sparsable for SparseSelector<T>
Source§fn sparse_init<'a>(
&mut self,
state: &mut SparseState,
metadata: &SparseMetadata,
depth: u32,
) -> Result<(), SparseError>
fn sparse_init<'a>( &mut self, state: &mut SparseState, metadata: &SparseMetadata, depth: u32, ) -> Result<(), SparseError>
Initialize recusively a Sparsable pointer
Source§fn sparse_updt<'a>(
&mut self,
state: &mut SparseState,
metadata: &SparseMetadata,
depth: u32,
) -> Result<(), SparseError>
fn sparse_updt<'a>( &mut self, state: &mut SparseState, metadata: &SparseMetadata, depth: u32, ) -> Result<(), SparseError>
Update recusively a Sparsable pointer
Source§fn check_depth(&self, depth: u32) -> Result<(), SparseError>
fn check_depth(&self, depth: u32) -> Result<(), SparseError>
Check if the current depth isn’t too much.
This is the cyclic pointer protection mechanism
Source§impl<T> SparsePointer<T> for SparseSelector<T>
impl<T> SparsePointer<T> for SparseSelector<T>
Source§fn check_version<'a>(
&'a self,
state: &'a SparseState,
) -> Result<(), SparseError>
fn check_version<'a>( &'a self, state: &'a SparseState, ) -> Result<(), SparseError>
Check if the inner value is outdated
Source§fn get(&self) -> Result<SparseValue<'_, T>, SparseError>
fn get(&self) -> Result<SparseValue<'_, T>, SparseError>
Get the inner value of the pointer
Source§fn get_mut(
&mut self,
root: Rc<RefCell<SparseState>>,
) -> Result<SparseValueMut<'_, T>, SparseError>
fn get_mut( &mut self, root: Rc<RefCell<SparseState>>, ) -> Result<SparseValueMut<'_, T>, SparseError>
Get the inner value of the pointer (mutable)
Source§fn 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
impl<T> StructuralPartialEq for SparseSelector<T>
Auto Trait Implementations§
impl<T> Freeze for SparseSelector<T>where
T: Freeze,
impl<T> RefUnwindSafe for SparseSelector<T>where
T: RefUnwindSafe,
impl<T> Send for SparseSelector<T>where
T: Send,
impl<T> Sync for SparseSelector<T>where
T: Sync,
impl<T> Unpin for SparseSelector<T>where
T: Unpin,
impl<T> UnwindSafe for SparseSelector<T>where
T: UnwindSafe,
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