pub fn delete(&self, path: &str) -> Result<Option<Value>> {
        if !self.store_exists() {
            return Err(Error::NotFound);
        }

        let mut parsed_json = self.get_store_as_parsed_json()?;
        let value = DotPaths::dot_take::<Value>(&mut parsed_json, path)?;
        self.write_value(parsed_json)?;
        Ok(value)
    }
/// Deletes the given path from the store.
///
/// # Example
///
/// ```rust
/// # use bland::Store;
/// let store = Store::new("delete-app").unwrap();
/// store.set("a.b", 42).unwrap();
/// assert_eq!(store.get("a.b").unwrap().unwrap(), 42);
/// store.delete("a.b").unwrap();
/// assert!(store.get("a.b").unwrap().is_none());
/// # store.delete_store().unwrap();
/// ```
///
/// # Errors
///
/// Errors if
/// * The store does not exist.
/// * It fails to read the store file.
/// * The store cannot be deserialized.
/// * The store file fails to be written to.
/// * `path` is not a valid dot path.
Deletes the given path from the store.
Deletes the given path from the store .
pub fn delete(&self, path: &str) -> Result<Option<Value>> {
        if !self.store_exists() {
            return Err(Error::NotFound);
        }
        let mut parsed_json = self.get_store_as_parsed_json()?;
        let value = DotPaths::dot_take::<Value>(&mut parsed_json, path)?;
        self.write_value(parsed_json)?;
        Ok(value)
    }
pub fn delete ( & self , path : & str ) -> Result < Option < Value > > { if ! self . store_exists ( ) { return Err ( Error :: NotFound ) ; } let mut parsed_json = self . get_store_as_parsed_json ( ) ? ; let value = DotPaths :: dot_take :: < Value > ( & mut parsed_json , path ) ? ; self . write_value ( parsed_json ) ? ; Ok ( value ) }
Deletes the given path from the store.
Deletes the given path from the store .
&self
path
&str
&self
path
&str
example
None
use bland::store;
None
store.delete_store().unwrap();
None
errors
Errors if
The store does not exist.
It fails to read the store file.
The store cannot be deserialized.
The store file fails to be written to.
`path` is not a valid dot path.
Errors if The store does not exist . It fails to read the store file . The store cannot be deserialized . The store file fails to be written to . ` path ` is not a valid dot path .