[][src]Struct seshat::SearchConfig

pub struct SearchConfig { /* fields omitted */ }

Search configuration A search configuration allows users to limit the search to a specific room or limit the search to specific event types. The search result can be configured in various ways as well.

Methods

impl SearchConfig[src]

pub fn new() -> Self[src]

Create a new default search configuration.

pub fn for_room(&mut self, room_id: &str) -> &mut Self[src]

Limit the search to a specific room. The default is to search all rooms.

Arguments

  • room_id - The unique id of the room.

pub fn limit(&mut self, limit: usize) -> &mut Self[src]

Limit the number of events that will be returned in the search result. The default for the limit is 10.

Arguments

  • limit - The max number of events to return in the search result.

pub fn before_limit(&mut self, limit: usize) -> &mut Self[src]

Limit the number of events that happened before our matching event in the search result. The default for the limit is 0.

Arguments

  • limit - The max number of contextual events to return in the search result.

pub fn after_limit(&mut self, limit: usize) -> &mut Self[src]

Limit the number of events that happened after our matching event in the search result. The default for the limit is 0.

Arguments

  • limit - The max number of contextual events to return in the search result.

pub fn order_by_recency(&mut self, order_by_recency: bool) -> &mut Self[src]

Should the matching events be ordered by recency. The default is to order them by the search score.

Arguments

  • order_by_recency - Flag to determine if we should order by recency. result.

pub fn with_key(&mut self, key: EventType) -> &mut Self[src]

Set the event types that should be used as search keys.

This limits which events will be searched for. This method can be called multiple times to add multiple event types. The default is to search all event types.

Arguments

  • key - The event type that should be included in the search.

Trait Implementations

impl Clone for SearchConfig[src]

impl Debug for SearchConfig[src]

impl Default for SearchConfig[src]

impl PartialEq<SearchConfig> for SearchConfig[src]

impl StructuralPartialEq for SearchConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Fruit for T where
    T: Send + Downcast, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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