pub enum Query<N: Network, B: BlockStorage<N>> {
VM(BlockStore<N, B>),
REST(Uri),
STATIC(StaticQuery<N>),
}
Expand description
Allows inspecting the state of the blockstain using either local state or a remote endpoint.
Variants§
VM(BlockStore<N, B>)
The block store from the VM.
REST(Uri)
The base URL of the node.
STATIC(StaticQuery<N>)
The local state to query.
Implementations§
Source§impl<N: Network, B: BlockStorage<N>> Query<N, B>
impl<N: Network, B: BlockStorage<N>> Query<N, B>
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, B: BlockStorage<N>> From<&BlockStore<N, B>> for Query<N, B>
Initialize the Query
object from a local BlockStore
.
impl<N: Network, B: BlockStorage<N>> From<&BlockStore<N, B>> for Query<N, B>
Initialize the Query
object from a local BlockStore
.
Source§fn from(block_store: &BlockStore<N, B>) -> Self
fn from(block_store: &BlockStore<N, B>) -> Self
Source§impl<N: Network, B: BlockStorage<N>> From<BlockStore<N, B>> for Query<N, B>
Initialize the Query
object from a local BlockStore
.
impl<N: Network, B: BlockStorage<N>> From<BlockStore<N, B>> for Query<N, B>
Initialize the Query
object from a local BlockStore
.
Source§fn from(block_store: BlockStore<N, B>) -> Self
fn from(block_store: BlockStore<N, B>) -> Self
Source§impl<N: Network, B: BlockStorage<N>> From<Uri> for Query<N, B>
Initialize the Query
object from an endpoint URL. The URI should point to a snarkOS node’s REST API.
impl<N: Network, B: BlockStorage<N>> From<Uri> for Query<N, B>
Initialize the Query
object from an endpoint URL. The URI should point to a snarkOS node’s REST API.
Source§impl<N: Network, B: BlockStorage<N>> FromStr for Query<N, B>
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, B: BlockStorage<N>> FromStr for Query<N, B>
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, B: BlockStorage<N>> QueryTrait<N> for Query<N, B>
impl<N: Network, B: BlockStorage<N>> QueryTrait<N> for Query<N, B>
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 commitment
s.
Source§fn current_block_height(&self) -> Result<u32>
fn current_block_height(&self) -> Result<u32>
Returns a state path for the given commitment
.
Source§impl<N: Network, B: BlockStorage<N>> TryFrom<&String> for Query<N, B>
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, B: BlockStorage<N>> TryFrom<&String> for Query<N, B>
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, B: BlockStorage<N>> TryFrom<&str> for Query<N, B>
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, B: BlockStorage<N>> TryFrom<&str> for Query<N, B>
Initialize the Query
object from an endpoint URL (passed as a string). The URI should point to a snarkOS node’s REST API.
Auto Trait Implementations§
impl<N, B> !Freeze for Query<N, B>
impl<N, B> !RefUnwindSafe for Query<N, B>
impl<N, B> Send for Query<N, B>
impl<N, B> Sync for Query<N, B>
impl<N, B> Unpin for Query<N, B>
impl<N, B> !UnwindSafe for Query<N, B>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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