Struct seshat::SearchConfig
source · pub struct SearchConfig { /* private fields */ }
Expand description
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.
Implementations§
source§impl SearchConfig
impl SearchConfig
sourcepub fn for_room(&mut self, room_id: &str) -> &mut Self
pub fn for_room(&mut self, room_id: &str) -> &mut Self
Limit the search to a specific room. The default is to search all rooms.
Arguments
room_id
- The unique id of the room.
sourcepub fn limit(&mut self, limit: usize) -> &mut Self
pub fn limit(&mut self, limit: usize) -> &mut Self
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.
sourcepub fn before_limit(&mut self, limit: usize) -> &mut Self
pub fn before_limit(&mut self, limit: usize) -> &mut Self
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.
sourcepub fn after_limit(&mut self, limit: usize) -> &mut Self
pub fn after_limit(&mut self, limit: usize) -> &mut Self
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.
sourcepub fn order_by_recency(&mut self, order_by_recency: bool) -> &mut Self
pub fn order_by_recency(&mut self, order_by_recency: bool) -> &mut Self
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.
sourcepub fn with_key(&mut self, key: EventType) -> &mut Self
pub fn with_key(&mut self, key: EventType) -> &mut Self
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.
sourcepub fn next_batch(&mut self, token: Uuid) -> &mut Self
pub fn next_batch(&mut self, token: Uuid) -> &mut Self
The point to return events from. If given, this should be a next_batch result from a previous search.
Trait Implementations§
source§impl Clone for SearchConfig
impl Clone for SearchConfig
source§fn clone(&self) -> SearchConfig
fn clone(&self) -> SearchConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SearchConfig
impl Debug for SearchConfig
source§impl Default for SearchConfig
impl Default for SearchConfig
source§impl<'de> Deserialize<'de> for SearchConfigwhere
SearchConfig: Default,
impl<'de> Deserialize<'de> for SearchConfigwhere SearchConfig: Default,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<SearchConfig> for SearchConfig
impl PartialEq<SearchConfig> for SearchConfig
source§fn eq(&self, other: &SearchConfig) -> bool
fn eq(&self, other: &SearchConfig) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SearchConfig
impl Serialize for SearchConfig
impl StructuralPartialEq for SearchConfig
Auto Trait Implementations§
impl RefUnwindSafe for SearchConfig
impl Send for SearchConfig
impl Sync for SearchConfig
impl Unpin for SearchConfig
impl UnwindSafe for SearchConfig
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.