pub struct RoomIndex { /* private fields */ }
Expand description
A struct that holds all data pertaining to a particular room’s message index.
Implementations§
Source§impl RoomIndex
impl RoomIndex
Sourcepub fn search(
&self,
query: &str,
max_number_of_results: usize,
pagination_offset: Option<usize>,
) -> Result<Vec<OwnedEventId>, IndexError>
pub fn search( &self, query: &str, max_number_of_results: usize, pagination_offset: Option<usize>, ) -> Result<Vec<OwnedEventId>, IndexError>
Search the RoomIndex
for some query. Returns a list of
results with a maximum given length. If pagination_offset
is
set then the results will start there, i.e.
if max_number_of_results = 3
and pagination_offset = 10
(and there are a surplus of results)
then this will return results 11, 12, 13
Sourcepub fn execute(
&mut self,
operation: RoomIndexOperation,
) -> Result<(), IndexError>
pub fn execute( &mut self, operation: RoomIndexOperation, ) -> Result<(), IndexError>
Execute RoomIndexOperation
If an error occurs, retry 5 times if possible.
This which will add/remove/edit an event in the index based on the operation.
Prefer RoomIndex::bulk_execute
for multiple operations.
Sourcepub fn bulk_execute(
&mut self,
operations: Vec<RoomIndexOperation>,
) -> Result<(), IndexError>
pub fn bulk_execute( &mut self, operations: Vec<RoomIndexOperation>, ) -> Result<(), IndexError>
Bulk execute RoomIndexOperation
s
If an error occurs in the batch it retries 5 times if possible.
This which will add/remove/edit an events in the index based on the operations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RoomIndex
impl !RefUnwindSafe for RoomIndex
impl Send for RoomIndex
impl Sync for RoomIndex
impl Unpin for RoomIndex
impl !UnwindSafe for RoomIndex
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more