pub struct Index { /* private fields */ }Expand description
SQLite-backed trace index. Cheap to construct; use one per process or thread.
Implementations§
Source§impl Index
impl Index
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open (or create) a SQLite database at path. Applies the schema
idempotently — safe to call on an existing DB.
Sourcepub fn open_in_memory() -> Result<Self>
pub fn open_in_memory() -> Result<Self>
Open an in-memory index (useful for tests).
Sourcepub fn register_trace(&mut self, trace: &TraceRecord) -> Result<()>
pub fn register_trace(&mut self, trace: &TraceRecord) -> Result<()>
Register a trace. Existing rows with the same id are replaced
(idempotent insert). Tags are cleared and re-inserted.
Sourcepub fn find_by_tag(&self, key: &str, value: &str) -> Result<Vec<String>>
pub fn find_by_tag(&self, key: &str, value: &str) -> Result<Vec<String>>
Trace ids with tags.key = :key AND tags.value = :value.
Sourcepub fn find_by_session_tag(&self, tag: &str) -> Result<Vec<String>>
pub fn find_by_session_tag(&self, tag: &str) -> Result<Vec<String>>
Trace ids with traces.session_tag = :tag.
Sourcepub fn recent(&self, limit: u32) -> Result<Vec<String>>
pub fn recent(&self, limit: u32) -> Result<Vec<String>>
The limit most recently-created trace ids.
Sourcepub fn register_replay(&mut self, replay: &ReplayRecord) -> Result<()>
pub fn register_replay(&mut self, replay: &ReplayRecord) -> Result<()>
Register a replay.
Sourcepub fn replays_of(&self, baseline_trace_id: &str) -> Result<Vec<ReplayRecord>>
pub fn replays_of(&self, baseline_trace_id: &str) -> Result<Vec<ReplayRecord>>
Replay records whose baseline is baseline_trace_id.
Auto Trait Implementations§
impl !Freeze for Index
impl !RefUnwindSafe for Index
impl Send for Index
impl !Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl !UnwindSafe for Index
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