pub struct PersonaStore { /* private fields */ }Expand description
Thread-safe in-memory persona registry.
Implementations§
Source§impl PersonaStore
impl PersonaStore
Sourcepub fn register(&self, persona: Persona)
pub fn register(&self, persona: Persona)
Registers a new persona, replacing any existing one with the same ID.
Sourcepub fn list_enabled(&self) -> Vec<Persona>
pub fn list_enabled(&self) -> Vec<Persona>
Returns all enabled personas.
Sourcepub fn set_enabled(&self, id: &str, enabled: bool) -> Result<()>
pub fn set_enabled(&self, id: &str, enabled: bool) -> Result<()>
Sets the enabled state of a persona.
Sourcepub fn load_from_slice(&self, personas: &[Persona])
pub fn load_from_slice(&self, personas: &[Persona])
Loads personas from a serializable slice.
Trait Implementations§
Source§impl Debug for PersonaStore
impl Debug for PersonaStore
Source§impl Default for PersonaStore
impl Default for PersonaStore
Source§fn default() -> PersonaStore
fn default() -> PersonaStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PersonaStore
impl !RefUnwindSafe for PersonaStore
impl Send for PersonaStore
impl Sync for PersonaStore
impl Unpin for PersonaStore
impl UnsafeUnpin for PersonaStore
impl UnwindSafe for PersonaStore
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