pub struct EntityPosteriors { /* private fields */ }Expand description
Bounded LRU map for per-entity posteriors. Uses a VecDeque to track access order; evicts oldest on insert when full.
Implementations§
Source§impl EntityPosteriors
impl EntityPosteriors
pub fn new(capacity: usize) -> Self
pub fn get_or_insert( &mut self, id: Uuid, default: impl FnOnce() -> BetaPosterior, ) -> &mut BetaPosterior
pub fn get(&self, id: &Uuid) -> Option<&BetaPosterior>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn to_snapshot(&self) -> HashMap<Uuid, BetaPosterior>
pub fn from_snapshot( snapshot: HashMap<Uuid, BetaPosterior>, capacity: usize, ) -> Self
Auto Trait Implementations§
impl Freeze for EntityPosteriors
impl RefUnwindSafe for EntityPosteriors
impl Send for EntityPosteriors
impl Sync for EntityPosteriors
impl Unpin for EntityPosteriors
impl UnsafeUnpin for EntityPosteriors
impl UnwindSafe for EntityPosteriors
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