Struct sppparse::SparseState[][src]

pub struct SparseState { /* fields omitted */ }

Implementations

impl SparseState[src]

pub fn new_from_file(path: PathBuf) -> Result<Self, SparseError>[src]

Create a new SparseState from a root file

pub fn new_from_value(path: PathBuf, val: Value) -> Result<Self, SparseError>[src]

Create a new SparseState from an in memory Value

pub fn get_root_path(&self) -> &PathBuf[src]

Get the root path of the state, if any

pub fn get_state_file<'a>(
    &'a self,
    path: &Path
) -> Result<&'a SparseStateFile, SparseError>
[src]

pub fn parse_root<S: DeserializeOwned + Serialize + SparsableTrait>(
    &mut self
) -> Result<S, SparseError>
[src]

Deserialize the root document from the state to the type S

pub fn parse_file<S: DeserializeOwned + Serialize + SparsableTrait>(
    &mut self,
    path: PathBuf
) -> Result<S, SparseError>
[src]

Deserialize a document from the state to the type S

pub fn add_value(
    &mut self,
    path: PathBuf,
    value: Value
) -> Result<(), SparseError>
[src]

Deserialize a file from the state to the type S

pub fn add_obj<S: DeserializeOwned + Serialize + SparsableTrait>(
    &mut self,
    path: PathBuf,
    obj: &mut S
) -> Result<(), SparseError>
[src]

Deserialize a file from the state to the type S

pub fn add_file(&mut self, path: PathBuf) -> Result<(), SparseError>[src]

Deserialize a file from the state to the type S

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

Write all the files in the states to disks It’ll try not to modify anything until it’s sure it can open every file for writing

Trait Implementations

impl Clone for SparseState[src]

impl Debug for SparseState[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,