pub struct Index { /* private fields */ }
Expand description
Indexer state and methods
Implementations§
Source§impl Index
impl Index
Sourcepub async fn connect(url: String) -> Result<Self, IndexError>
pub async fn connect(url: String) -> Result<Self, IndexError>
Connect to a Acuity Substrate Index node via WebSocket
Sourcepub async fn subscribe_status(
&mut self,
) -> Result<impl Stream<Item = Result<Vec<Span>, IndexError>> + '_, IndexError>
pub async fn subscribe_status( &mut self, ) -> Result<impl Stream<Item = Result<Vec<Span>, IndexError>> + '_, IndexError>
Subscribe to a stream of status updates.
Sourcepub async fn unsubscribe_status(&mut self) -> Result<(), IndexError>
pub async fn unsubscribe_status(&mut self) -> Result<(), IndexError>
Unsubscribe to a stream of status updates.
Sourcepub async fn size_on_disk(&mut self) -> Result<u64, IndexError>
pub async fn size_on_disk(&mut self) -> Result<u64, IndexError>
Request size on disk.
Sourcepub async fn get_variants(&mut self) -> Result<Vec<PalletMeta>, IndexError>
pub async fn get_variants(&mut self) -> Result<Vec<PalletMeta>, IndexError>
Request a list of all event variants being indexed.
Sourcepub async fn get_events(&mut self, key: Key) -> Result<Vec<Event>, IndexError>
pub async fn get_events(&mut self, key: Key) -> Result<Vec<Event>, IndexError>
Get events that have emitted a specific key.
Sourcepub async fn subscribe_events(
&mut self,
key: Key,
) -> Result<impl Stream<Item = Result<Vec<Event>, IndexError>> + '_, IndexError>
pub async fn subscribe_events( &mut self, key: Key, ) -> Result<impl Stream<Item = Result<Vec<Event>, IndexError>> + '_, IndexError>
Subscribe to events that have emitted a specific key.
Sourcepub async fn unsubscribe_events(&mut self, key: Key) -> Result<(), IndexError>
pub async fn unsubscribe_events(&mut self, key: Key) -> Result<(), IndexError>
Unsubscribe to an event subscription.
Auto Trait Implementations§
impl !Freeze for Index
impl !RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl !UnwindSafe for Index
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> 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>
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