pub struct AppPrefs<T: Sized + Clone + Serialize + DeserializeOwned> {
pub data: T,
/* private fields */
}
Expand description
§Usage
struct Settings {
user: String,
theme: usize
}
let mut prefs: AppPrefs<Settings> = AppPrefs::new("com","example","readme", || Settings::default()).unwrap();
println!("{}", prefs.data.user);
prefs.data.user = String::from("New");
prefs.save();
Fields§
§data: T
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AppPrefs<T>where
T: Freeze,
impl<T> RefUnwindSafe for AppPrefs<T>where
T: RefUnwindSafe,
impl<T> Send for AppPrefs<T>where
T: Send,
impl<T> Sync for AppPrefs<T>where
T: Sync,
impl<T> Unpin for AppPrefs<T>where
T: Unpin,
impl<T> UnwindSafe for AppPrefs<T>where
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