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,

source

pub async fn execute(&mut self, client: &Client) -> Result<D::Response>

Execute this query against the provided client of the Hedera network.

source

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.

source

pub fn subscribe<'a>(&self, client: &'a Client) -> D::ItemStream<'a>

Subscribe to this query with the provided client of the Hedera network.

source

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,

source

pub fn new() -> Self

Create a new query ready for configuration and execution.

source§

impl MirrorQuery<NodeAddressBookQueryData>

source

pub fn get_file_id(&self) -> FileId

Returns the file ID of the address book file on the network.

source

pub fn file_id(&mut self, id: impl Into<FileId>) -> &mut Self

Sets the ID of the address book file on the network. Can either be 0.0.101 or 0.0.102. Defaults to 0.0.102.

source

pub fn get_limit(&self) -> u32

Returns the configured limit of node addresses to receive.

source

pub fn limit(&mut self, limit: u32) -> &mut Self

Sets the maximum number of node addresses to receive. Defaults to all.

source§

impl MirrorQuery<TopicMessageQueryData>

source

pub fn get_topic_id(&self) -> Option<TopicId>

Returns the ID of the topic to retrieve messages for.

source

pub fn topic_id(&mut self, id: impl Into<TopicId>) -> &mut Self

Sets the topic ID to retrieve messages for.

source

pub fn get_start_time(&self) -> Option<OffsetDateTime>

Returns the minimum consensus_timestamp of the messages to return.

source

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.

source

pub fn get_end_time(&self) -> Option<OffsetDateTime>

Returns the maximum consensus_timestamp of the messages to return.

source

pub fn end_time(&mut self, time: OffsetDateTime) -> &mut Self

Sets to include messages which reached consensus before this time.

source

pub fn get_limit(&self) -> u64

Returns maximum number of messages to be returned.

source

pub fn limit(&mut self, limit: u64) -> &mut Self

Sets the maximum number of messages to be returned, before closing the subscription. Defaults to unlimited.

Trait Implementations§

source§

impl<D: Clone> Clone for MirrorQuery<D>

source§

fn clone(&self) -> MirrorQuery<D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D: Debug> Debug for MirrorQuery<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: Default> Default for MirrorQuery<D>

source§

fn default() -> MirrorQuery<D>

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more