pub enum BlockReference {
Finality(Finality),
Height(u64),
Hash(CryptoHash),
SyncCheckpoint(SyncCheckpoint),
}Expand description
Reference to a specific block for RPC queries.
Every NEAR RPC query operates on state at a specific block.
Variants§
Finality(Finality)
Query at latest block with specified finality.
Height(u64)
Query at specific block height.
Hash(CryptoHash)
Query at specific block hash.
SyncCheckpoint(SyncCheckpoint)
Query at a sync checkpoint (genesis or earliest available).
Implementations§
Source§impl BlockReference
impl BlockReference
Sourcepub fn optimistic() -> Self
pub fn optimistic() -> Self
Query at optimistic (latest) block.
Sourcepub fn near_final() -> Self
pub fn near_final() -> Self
Query at near-final block.
Sourcepub fn at_hash(hash: CryptoHash) -> Self
pub fn at_hash(hash: CryptoHash) -> Self
Query at specific hash.
Sourcepub fn earliest_available() -> Self
pub fn earliest_available() -> Self
Query at earliest available block.
Sourcepub fn to_rpc_params(&self) -> Value
pub fn to_rpc_params(&self) -> Value
Convert to JSON for RPC requests.
Trait Implementations§
Source§impl Clone for BlockReference
impl Clone for BlockReference
Source§fn clone(&self) -> BlockReference
fn clone(&self) -> BlockReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockReference
impl Debug for BlockReference
Source§impl Default for BlockReference
impl Default for BlockReference
Source§impl From<CryptoHash> for BlockReference
impl From<CryptoHash> for BlockReference
Source§fn from(hash: CryptoHash) -> Self
fn from(hash: CryptoHash) -> Self
Converts to this type from the input type.
Source§impl From<Finality> for BlockReference
impl From<Finality> for BlockReference
Source§impl From<u64> for BlockReference
impl From<u64> for BlockReference
Source§impl PartialEq for BlockReference
impl PartialEq for BlockReference
impl Eq for BlockReference
impl StructuralPartialEq for BlockReference
Auto Trait Implementations§
impl Freeze for BlockReference
impl RefUnwindSafe for BlockReference
impl Send for BlockReference
impl Sync for BlockReference
impl Unpin for BlockReference
impl UnsafeUnpin for BlockReference
impl UnwindSafe for BlockReference
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.