pub struct Profiles { /* private fields */ }Expand description
The list of profiles, in the order they were made, and the one in use.
Implementations§
Source§impl Profiles
impl Profiles
Sourcepub fn first(name: &str) -> Self
pub fn first(name: &str) -> Self
A list of one profile, ProfileId::FIRST, called name, in use.
Sourcepub fn set_current(&mut self, id: ProfileId) -> Result<(), ProfileError>
pub fn set_current(&mut self, id: ProfileId) -> Result<(), ProfileError>
Makes id the profile in use.
Sourcepub fn add(&mut self, name: &str) -> Result<ProfileId, ProfileError>
pub fn add(&mut self, name: &str) -> Result<ProfileId, ProfileError>
Adds a profile called name (spaces around it dropped) and returns
its id. The profile in use stays the same.
Sourcepub fn rename(&mut self, id: ProfileId, name: &str) -> Result<(), ProfileError>
pub fn rename(&mut self, id: ProfileId, name: &str) -> Result<(), ProfileError>
Renames the profile id to name (spaces around it dropped).
Sourcepub fn remove(&mut self, id: ProfileId) -> Result<(), ProfileError>
pub fn remove(&mut self, id: ProfileId) -> Result<(), ProfileError>
Takes the profile id off the list (not its keys:
delete_keys). If it was in use, the first profile left is.
Sourcepub fn from_ron(text: &str) -> Result<Self, String>
pub fn from_ron(text: &str) -> Result<Self, String>
Reads the saved form. Text that can’t be read, of another version
or with no profile in it gives Err with why. A current that
isn’t on the list is the first profile; a next_id that some
profile already has is moved past them all.
Sourcepub fn save(&self, storage: &mut dyn Storage) -> Result<(), StorageError>
pub fn save(&self, storage: &mut dyn Storage) -> Result<(), StorageError>
Saves the list under PROFILES_KEY.
Trait Implementations§
impl Eq for Profiles
impl StructuralPartialEq for Profiles
Auto Trait Implementations§
impl Freeze for Profiles
impl RefUnwindSafe for Profiles
impl Send for Profiles
impl Sync for Profiles
impl Unpin for Profiles
impl UnsafeUnpin for Profiles
impl UnwindSafe for Profiles
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