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<(f32, OwnedEventId)>, IndexError>
pub fn search( &self, query: &str, max_number_of_results: usize, pagination_offset: Option<usize>, ) -> Result<Vec<(f32, 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 RoomIndexOperations
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.
Waits for background merge threads to prevent racing with subsequent calls.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RoomIndex
impl !RefUnwindSafe for RoomIndex
impl !UnwindSafe for RoomIndex
impl Send for RoomIndex
impl Sync for RoomIndex
impl Unpin for RoomIndex
impl UnsafeUnpin 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
§impl<T> CompatExt for T
impl<T> CompatExt for T
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>
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>
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)
&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)
&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> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read moreSource§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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