Struct hedera::MirrorQuery
source · pub struct MirrorQuery<D> { /* private fields */ }
Expand description
A query that can be executed on the Hedera mirror network.
Implementations§
source§impl<D> MirrorQuery<D>where
D: MirrorQueryExecute,
impl<D> MirrorQuery<D>where
D: MirrorQueryExecute,
sourcepub async fn execute(&mut self, client: &Client) -> Result<D::Response>
pub async fn execute(&mut self, client: &Client) -> Result<D::Response>
Execute this query against the provided client of the Hedera network.
sourcepub async fn execute_with_timeout(
&mut self,
client: &Client,
timeout: Duration
) -> Result<D::Response>
pub async fn execute_with_timeout( &mut self, client: &Client, timeout: Duration ) -> Result<D::Response>
Execute this query against the provided client of the Hedera network.
Note that timeout
is the connection timeout.
sourcepub fn subscribe<'a>(&self, client: &'a Client) -> D::ItemStream<'a>
pub fn subscribe<'a>(&self, client: &'a Client) -> D::ItemStream<'a>
Subscribe to this query with the provided client of the Hedera network.
sourcepub fn subscribe_with_timeout<'a>(
&self,
client: &'a Client,
timeout: Duration
) -> D::ItemStream<'a>
pub fn subscribe_with_timeout<'a>( &self, client: &'a Client, timeout: Duration ) -> D::ItemStream<'a>
Subscribe to this query with the provided client of the Hedera network.
Note that timeout
is the connection timeout.
source§impl<D> MirrorQuery<D>where
D: MirrorQueryExecute + Default,
impl<D> MirrorQuery<D>where
D: MirrorQueryExecute + Default,
source§impl MirrorQuery<NodeAddressBookQueryData>
impl MirrorQuery<NodeAddressBookQueryData>
source§impl MirrorQuery<TopicMessageQueryData>
impl MirrorQuery<TopicMessageQueryData>
sourcepub fn get_topic_id(&self) -> Option<TopicId>
pub fn get_topic_id(&self) -> Option<TopicId>
Returns the ID of the topic to retrieve messages for.
sourcepub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self
pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self
Sets the topic ID to retrieve messages for.
sourcepub fn get_start_time(&self) -> Option<OffsetDateTime>
pub fn get_start_time(&self) -> Option<OffsetDateTime>
Returns the minimum consensus_timestamp
of the messages to return.
sourcepub fn start_time(&mut self, time: OffsetDateTime) -> &mut Self
pub fn start_time(&mut self, time: OffsetDateTime) -> &mut Self
Sets to include messages which reached consensus on or after this time. Defaults to the current time.
sourcepub fn get_end_time(&self) -> Option<OffsetDateTime>
pub fn get_end_time(&self) -> Option<OffsetDateTime>
Returns the maximum consensus_timestamp
of the messages to return.
sourcepub fn end_time(&mut self, time: OffsetDateTime) -> &mut Self
pub fn end_time(&mut self, time: OffsetDateTime) -> &mut Self
Sets to include messages which reached consensus before this time.
Trait Implementations§
source§impl<D: Clone> Clone for MirrorQuery<D>
impl<D: Clone> Clone for MirrorQuery<D>
source§fn clone(&self) -> MirrorQuery<D>
fn clone(&self) -> MirrorQuery<D>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<D: Debug> Debug for MirrorQuery<D>
impl<D: Debug> Debug for MirrorQuery<D>
source§impl<D: Default> Default for MirrorQuery<D>
impl<D: Default> Default for MirrorQuery<D>
source§fn default() -> MirrorQuery<D>
fn default() -> MirrorQuery<D>
Auto Trait Implementations§
impl<D> Freeze for MirrorQuery<D>where
D: Freeze,
impl<D> RefUnwindSafe for MirrorQuery<D>where
D: RefUnwindSafe,
impl<D> Send for MirrorQuery<D>where
D: Send,
impl<D> Sync for MirrorQuery<D>where
D: Sync,
impl<D> Unpin for MirrorQuery<D>where
D: Unpin,
impl<D> UnwindSafe for MirrorQuery<D>where
D: UnwindSafe,
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request