pub struct File<T, P = PathBuf>{
pub path: P,
pub fmt: Format,
pub inner: T,
}
Fields§
§path: P
§fmt: Format
§inner: T
Implementations§
Source§impl<T, P> File<T, P>
impl<T, P> File<T, P>
pub fn into_inner(self) -> T
pub fn new(path: P, inner: T) -> Result<Self, Error>
pub fn with_fmt(path: P, fmt: Format) -> Result<Self, Error>where
T: DeserializeOwned,
pub fn load(self) -> Result<(), Error>where
T: DeserializeOwned,
pub fn to_string(&self) -> Result<String, Error>where
T: Serialize,
pub fn save(&self) -> Result<(), Error>where
T: Serialize,
Trait Implementations§
Auto Trait Implementations§
impl<T, P> Freeze for File<T, P>
impl<T, P> RefUnwindSafe for File<T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for File<T, P>
impl<T, P> Sync for File<T, P>
impl<T, P> Unpin for File<T, P>
impl<T, P> UnwindSafe for File<T, P>where
P: UnwindSafe,
T: UnwindSafe,
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