pub struct PerspectiveStore {
pub perspectives: Vec<Perspective>,
pub learned_perspectives: Vec<PerspectiveId>,
/* private fields */
}Expand description
All known perspectives.
Fields§
§perspectives: Vec<Perspective>§learned_perspectives: Vec<PerspectiveId>IDs of perspectives auto-discovered from usage patterns.
Implementations§
Source§impl PerspectiveStore
impl PerspectiveStore
pub fn new() -> Self
Sourcepub fn alloc_id(&mut self) -> PerspectiveId
pub fn alloc_id(&mut self) -> PerspectiveId
Allocate a new perspective ID.
Sourcepub fn insert(&mut self, perspective: Perspective)
pub fn insert(&mut self, perspective: Perspective)
Add a perspective.
Sourcepub fn get(&self, id: PerspectiveId) -> Option<&Perspective>
pub fn get(&self, id: PerspectiveId) -> Option<&Perspective>
Find a perspective by ID.
Sourcepub fn find_by_name(&self, name: &str) -> Option<&Perspective>
pub fn find_by_name(&self, name: &str) -> Option<&Perspective>
Find a perspective by name.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for PerspectiveStore
impl Clone for PerspectiveStore
Source§fn clone(&self) -> PerspectiveStore
fn clone(&self) -> PerspectiveStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PerspectiveStore
impl Debug for PerspectiveStore
Source§impl<'de> Deserialize<'de> for PerspectiveStore
impl<'de> Deserialize<'de> for PerspectiveStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PerspectiveStore
impl RefUnwindSafe for PerspectiveStore
impl Send for PerspectiveStore
impl Sync for PerspectiveStore
impl Unpin for PerspectiveStore
impl UnsafeUnpin for PerspectiveStore
impl UnwindSafe for PerspectiveStore
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