Struct sppparse::SparseRoot[][src]

pub struct SparseRoot<S: DeserializeOwned + Serialize + SparsableTrait> { /* fields omitted */ }

Implementations

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]

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]

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]

Create a new SparseRoot from a serialized object

pub fn save_to_disk(
    &self,
    format: Option<SparseFileFormat>
) -> Result<(), SparseError>
[src]

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> Display for SparseRoot<S> where
    S: DeserializeOwned + Serialize + SparsableTrait + Display
[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for SparseRoot<S>

impl<S> !Send for SparseRoot<S>

impl<S> !Sync for SparseRoot<S>

impl<S> Unpin for SparseRoot<S> where
    S: Unpin

impl<S> !UnwindSafe for SparseRoot<S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,