Skip to main content

SessionFilter

Enum SessionFilter 

Source
pub enum SessionFilter {
Show 15 variants ByStatus(SessionStatus), ByTypeName(String), HasTag(String), CreatedAfter(Timestamp), CreatedBefore(Timestamp), UpdatedAfter(Timestamp), UpdatedBefore(Timestamp), NameContains(String), HasParent, WithParent(SessionId), IsRoot, And(Vec<SessionFilter>), Or(Vec<SessionFilter>), Not(Box<SessionFilter>), All,
}
Expand description

Filter for querying sessions.

Filters can be combined using SessionFilter::And for complex queries.

§Example

use thulp_workspace::{SessionFilter, SessionStatus};

// Find active conversation sessions
let filter = SessionFilter::And(vec![
    SessionFilter::ByStatus(SessionStatus::Active),
    SessionFilter::ByTypeName("conversation".to_string()),
]);

Variants§

§

ByStatus(SessionStatus)

Match sessions with the given status.

§

ByTypeName(String)

Match sessions by type name (e.g., “conversation”, “teacher_demo”).

§

HasTag(String)

Match sessions that have a specific tag.

§

CreatedAfter(Timestamp)

Match sessions created after the given timestamp.

§

CreatedBefore(Timestamp)

Match sessions created before the given timestamp.

§

UpdatedAfter(Timestamp)

Match sessions updated after the given timestamp.

§

UpdatedBefore(Timestamp)

Match sessions updated before the given timestamp.

§

NameContains(String)

Match sessions where the name contains the given text.

§

HasParent

Match sessions that have a parent session.

§

WithParent(SessionId)

Match sessions with a specific parent session ID.

§

IsRoot

Match sessions that are root sessions (no parent).

§

And(Vec<SessionFilter>)

Combine multiple filters with AND logic.

§

Or(Vec<SessionFilter>)

Combine multiple filters with OR logic.

§

Not(Box<SessionFilter>)

Negate a filter.

§

All

Match all sessions.

Implementations§

Source§

impl SessionFilter

Source

pub fn matches(&self, session: &Session) -> bool

Check if a session matches this filter.

Source

pub fn and(self, other: SessionFilter) -> SessionFilter

Create an AND filter from two filters.

Source

pub fn or(self, other: SessionFilter) -> SessionFilter

Create an OR filter from two filters.

Source

pub fn negate(self) -> SessionFilter

Negate this filter.

Source

pub fn active() -> Self

Create a filter for active sessions.

Source

pub fn completed() -> Self

Create a filter for completed sessions.

Source

pub fn failed() -> Self

Create a filter for failed sessions.

Source

pub fn conversations() -> Self

Create a filter for conversation sessions.

Source

pub fn teacher_demos() -> Self

Create a filter for teacher demo sessions.

Source

pub fn evaluations() -> Self

Create a filter for evaluation sessions.

Source

pub fn refinements() -> Self

Create a filter for refinement sessions.

Source

pub fn agent_sessions() -> Self

Create a filter for agent sessions.

Trait Implementations§

Source§

impl Clone for SessionFilter

Source§

fn clone(&self) -> SessionFilter

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionFilter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more