pub struct Storage {
pub file: Option<File>,
/* private fields */
}
Fields§
§file: Option<File>
Implementations§
source§impl Storage
impl Storage
sourcepub fn load_file(
&mut self,
file_path: Option<&str>
) -> Result<Vec<KV>, Box<dyn Error>>
pub fn load_file( &mut self, file_path: Option<&str> ) -> Result<Vec<KV>, Box<dyn Error>>
Loads the file from the specified or existing file path and deserializes the content.
§Arguments
file_path
- An optional string slice that holds the file path.
§Returns
Ok(Vec<KV>)
- A vector of deserialized KV structs if the operation is successful.Box<dyn Error>>
- An error message if the operation fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more