Skip to main content

Index

Struct Index 

Source
pub struct Index { /* private fields */ }
Expand description

SQLite-backed trace index. Cheap to construct; use one per process or thread.

Implementations§

Source§

impl Index

Source

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.

Source

pub fn open_in_memory() -> Result<Self>

Open an in-memory index (useful for tests).

Source

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.

Source

pub fn get_trace(&self, id: &str) -> Result<Option<TraceRecord>>

Look up a trace by id.

Source

pub fn find_by_tag(&self, key: &str, value: &str) -> Result<Vec<String>>

Trace ids with tags.key = :key AND tags.value = :value.

Source

pub fn find_by_session_tag(&self, tag: &str) -> Result<Vec<String>>

Trace ids with traces.session_tag = :tag.

Source

pub fn recent(&self, limit: u32) -> Result<Vec<String>>

The limit most recently-created trace ids.

Source

pub fn register_replay(&mut self, replay: &ReplayRecord) -> Result<()>

Register a replay.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Ungil for T
where T: Send,