Struct sppparse::SparseState [−][src]
pub struct SparseState { /* fields omitted */ }Implementations
impl SparseState[src]
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: &PathBuf
) -> Result<&'a SparseStateFile, SparseError>[src]
&'a self,
path: &PathBuf
) -> Result<&'a SparseStateFile, SparseError>
pub fn parse_root<S: DeserializeOwned + Serialize + SparsableTrait>(
&mut self
) -> Result<S, SparseError>[src]
&mut self
) -> Result<S, SparseError>
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]
&mut self,
path: PathBuf
) -> Result<S, SparseError>
Deserialize a document from the state to the type S
pub fn add_value(
&mut self,
path: PathBuf,
value: Value
) -> Result<(), SparseError>[src]
&mut self,
path: PathBuf,
value: Value
) -> Result<(), SparseError>
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]
&mut self,
path: PathBuf,
obj: &mut S
) -> Result<(), SparseError>
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]
&self,
format: Option<SparseFileFormat>
) -> Result<(), SparseError>
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 Clone for SparseState[src]fn clone(&self) -> SparseState[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for SparseState
impl RefUnwindSafe for SparseStateimpl Send for SparseState
impl Send for SparseStateimpl Sync for SparseState
impl Sync for SparseStateimpl Unpin for SparseState
impl Unpin for SparseStateimpl UnwindSafe for SparseState
impl UnwindSafe for SparseState