pub struct InstrumentStore { /* private fields */ }Expand description
Local instrument storage with initialization tracking.
Provides add/find/get_all operations for instrument caching.
Not thread-safe by itself; wrap in Arc<RwLock<InstrumentStore>> when
sharing across async tasks or WebSocket handlers.
Implementations§
Source§impl InstrumentStore
impl InstrumentStore
Sourcepub fn add(&mut self, instrument: InstrumentAny)
pub fn add(&mut self, instrument: InstrumentAny)
Adds an instrument to the store, replacing any existing entry with the same ID.
Sourcepub fn add_bulk(&mut self, instruments: Vec<InstrumentAny>)
pub fn add_bulk(&mut self, instruments: Vec<InstrumentAny>)
Adds multiple instruments to the store.
Sourcepub fn find(&self, instrument_id: &InstrumentId) -> Option<&InstrumentAny>
pub fn find(&self, instrument_id: &InstrumentId) -> Option<&InstrumentAny>
Returns the instrument for the given ID, if found.
Sourcepub fn contains(&self, instrument_id: &InstrumentId) -> bool
pub fn contains(&self, instrument_id: &InstrumentId) -> bool
Returns whether the store contains the given instrument ID.
Sourcepub fn get_all(&self) -> &AHashMap<InstrumentId, InstrumentAny>
pub fn get_all(&self) -> &AHashMap<InstrumentId, InstrumentAny>
Returns all instruments as a map keyed by instrument ID.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Returns whether the store has been marked as initialized.
Sourcepub fn set_initialized(&mut self)
pub fn set_initialized(&mut self)
Marks the store as initialized.
Trait Implementations§
Source§impl Debug for InstrumentStore
impl Debug for InstrumentStore
Source§impl Default for InstrumentStore
impl Default for InstrumentStore
Source§fn default() -> InstrumentStore
fn default() -> InstrumentStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InstrumentStore
impl RefUnwindSafe for InstrumentStore
impl Send for InstrumentStore
impl Sync for InstrumentStore
impl Unpin for InstrumentStore
impl UnsafeUnpin for InstrumentStore
impl UnwindSafe for InstrumentStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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