pub struct RestQuery<N: Network> { /* private fields */ }Expand description
Queries that use a node’s REST API as their source of information.
Implementations§
Source§impl<N: Network> RestQuery<N>
impl<N: Network> RestQuery<N>
Sourcepub fn get_transaction(
&self,
transaction_id: &N::TransactionID,
) -> Result<Transaction<N>>
pub fn get_transaction( &self, transaction_id: &N::TransactionID, ) -> Result<Transaction<N>>
Returns the transaction for the given transaction ID.
Sourcepub fn get_program(&self, program_id: &ProgramID<N>) -> Result<Program<N>>
pub fn get_program(&self, program_id: &ProgramID<N>) -> Result<Program<N>>
Returns the program for the given program ID.
Trait Implementations§
Source§impl<N: Network> FromStr for RestQuery<N>
Initialize the Query object from an endpoint URL (passed as a string). The URI should point to a snarkOS node’s REST API.
impl<N: Network> FromStr for RestQuery<N>
Initialize the Query object from an endpoint URL (passed as a string). The URI should point to a snarkOS node’s REST API.
Source§impl<N: Network> QueryTrait<N> for RestQuery<N>
impl<N: Network> QueryTrait<N> for RestQuery<N>
Source§fn current_state_root(&self) -> Result<N::StateRoot>
fn current_state_root(&self) -> Result<N::StateRoot>
Returns the current state root.
Source§fn get_state_path_for_commitment(
&self,
commitment: &Field<N>,
) -> Result<StatePath<N>>
fn get_state_path_for_commitment( &self, commitment: &Field<N>, ) -> Result<StatePath<N>>
Returns a state path for the given commitment.
Source§fn get_state_paths_for_commitments(
&self,
commitments: &[Field<N>],
) -> Result<Vec<StatePath<N>>>
fn get_state_paths_for_commitments( &self, commitments: &[Field<N>], ) -> Result<Vec<StatePath<N>>>
Returns a list of state paths for the given list of commitments.
Source§fn current_block_height(&self) -> Result<u32>
fn current_block_height(&self) -> Result<u32>
Returns a state path for the given commitment.
Auto Trait Implementations§
impl<N> !Freeze for RestQuery<N>
impl<N> RefUnwindSafe for RestQuery<N>where
N: RefUnwindSafe,
impl<N> Send for RestQuery<N>
impl<N> Sync for RestQuery<N>
impl<N> Unpin for RestQuery<N>where
N: Unpin,
impl<N> UnwindSafe for RestQuery<N>where
N: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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