pub struct VisualMemoryStore {
pub observations: Vec<VisualObservation>,
pub embedding_dim: u32,
pub next_id: u64,
pub session_count: u32,
pub created_at: u64,
pub updated_at: u64,
}Expand description
In-memory container for all visual observations.
Fields§
§observations: Vec<VisualObservation>§embedding_dim: u32§next_id: u64§session_count: u32§created_at: u64§updated_at: u64Implementations§
Source§impl VisualMemoryStore
impl VisualMemoryStore
Sourcepub fn get(&self, id: u64) -> Option<&VisualObservation>
pub fn get(&self, id: u64) -> Option<&VisualObservation>
Get an observation by ID.
Sourcepub fn get_mut(&mut self, id: u64) -> Option<&mut VisualObservation>
pub fn get_mut(&mut self, id: u64) -> Option<&mut VisualObservation>
Get a mutable observation by ID.
Sourcepub fn add(&mut self, obs: VisualObservation) -> u64
pub fn add(&mut self, obs: VisualObservation) -> u64
Add an observation and return its assigned ID.
Sourcepub fn by_session(&self, session_id: u32) -> Vec<&VisualObservation>
pub fn by_session(&self, session_id: u32) -> Vec<&VisualObservation>
Get observations filtered by session ID.
Sourcepub fn in_time_range(&self, start: u64, end: u64) -> Vec<&VisualObservation>
pub fn in_time_range(&self, start: u64, end: u64) -> Vec<&VisualObservation>
Get observations in a timestamp range.
Sourcepub fn recent(&self, limit: usize) -> Vec<&VisualObservation>
pub fn recent(&self, limit: usize) -> Vec<&VisualObservation>
Get the most recent observations.
Trait Implementations§
Source§impl Clone for VisualMemoryStore
impl Clone for VisualMemoryStore
Source§fn clone(&self) -> VisualMemoryStore
fn clone(&self) -> VisualMemoryStore
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 moreAuto Trait Implementations§
impl Freeze for VisualMemoryStore
impl RefUnwindSafe for VisualMemoryStore
impl Send for VisualMemoryStore
impl Sync for VisualMemoryStore
impl Unpin for VisualMemoryStore
impl UnsafeUnpin for VisualMemoryStore
impl UnwindSafe for VisualMemoryStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more