Struct sppparse::SparseRoot [−][src]
pub struct SparseRoot<S: DeserializeOwned + Serialize + SparsableTrait> { /* fields omitted */ }
Implementations
impl<S: DeserializeOwned + Serialize + SparsableTrait> SparseRoot<S>
[src]
impl<S: DeserializeOwned + Serialize + SparsableTrait> SparseRoot<S>
[src]pub fn state(&self) -> &Rc<RefCell<SparseState>>
[src]
pub fn metadata(&self) -> &SparseMetadata
[src]
impl<S> SparseRoot<S> where
S: DeserializeOwned + Serialize + SparsableTrait,
[src]
impl<S> SparseRoot<S> where
S: DeserializeOwned + Serialize + SparsableTrait,
[src]pub fn check_version(&self) -> Result<(), SparseError>
[src]
Get the value this selector is managing, either by deserializing the pointed value or by directly returning the owned value.
pub fn root_get(&self) -> Result<SparseValue<'_, S>, SparseError>
[src]
Get the value this selector is managing, either by deserializing the pointed value or by directly returning the owned value.
pub fn root_get_mut(&mut self) -> Result<SparseValueMut<'_, S>, SparseError>
[src]
Like root_get
but return a mutable reference
pub fn root_self_reset(&mut self) -> Result<(), SparseError>
[src]
Reset the root object in case of initialization or update
pub fn sparse_init(&mut self) -> Result<(), SparseError>
[src]
Intitialize the inner state
pub fn sparse_updt(&mut self) -> Result<(), SparseError>
[src]
Update the inner state
pub fn new_from_file(path: PathBuf) -> Result<Self, SparseError>
[src]
Create a new SparseRoot from file path
pub fn new_from_value(
rval: Value,
path: PathBuf,
others: Vec<(Value, PathBuf)>
) -> Result<Self, SparseError>
[src]
rval: Value,
path: PathBuf,
others: Vec<(Value, PathBuf)>
) -> Result<Self, SparseError>
Create a new SparseRoot from a Value object
pub fn new_from_obj(
rval: S,
path: PathBuf,
others: Vec<(&mut S, PathBuf)>
) -> Result<Self, SparseError>
[src]
rval: S,
path: PathBuf,
others: Vec<(&mut S, PathBuf)>
) -> Result<Self, SparseError>
Create a new SparseRoot from a serialized object
pub fn save_to_disk(
&self,
format: Option<SparseFileFormat>
) -> Result<(), SparseError>
[src]
&self,
format: Option<SparseFileFormat>
) -> Result<(), SparseError>
Save the state to disk in the specified format. If not format is specified, the format in which the document was read will be used. If the document was read from memory, it’ll be written in prettified JSON
Trait Implementations
impl<S: Debug + DeserializeOwned + Serialize + SparsableTrait> Debug for SparseRoot<S>
[src]
impl<S: Debug + DeserializeOwned + Serialize + SparsableTrait> Debug for SparseRoot<S>
[src]impl<S> Display for SparseRoot<S> where
S: DeserializeOwned + Serialize + SparsableTrait + Display,
[src]
impl<S> Display for SparseRoot<S> where
S: DeserializeOwned + Serialize + SparsableTrait + Display,
[src]Auto Trait Implementations
impl<S> !RefUnwindSafe for SparseRoot<S>
impl<S> !RefUnwindSafe for SparseRoot<S>
impl<S> !Send for SparseRoot<S>
impl<S> !Send for SparseRoot<S>
impl<S> !Sync for SparseRoot<S>
impl<S> !Sync for SparseRoot<S>
impl<S> Unpin for SparseRoot<S> where
S: Unpin,
impl<S> Unpin for SparseRoot<S> where
S: Unpin,
impl<S> !UnwindSafe for SparseRoot<S>
impl<S> !UnwindSafe for SparseRoot<S>