pub enum BlockIdentifier {
Number((Chain, i64)),
Hash(BlockHash),
Latest(Chain),
}Expand description
Identifies a block in storage.
Variants§
Number((Chain, i64))
Identifies the block by its position on a specified chain.
This form of identification has potential risks as it may become ambiguous in certain situations. For example, if the block has not been finalised, there exists a possibility of forks occurring. As a result, the same number could refer to different blocks on different forks.
Hash(BlockHash)
Identifies a block by its hash.
The hash should be unique across multiple chains. Preferred method if the block is very recent.
Latest(Chain)
Latest stored block for the target chain
Returns the block with the highest block number on the target chain.
Trait Implementations§
Source§impl Clone for BlockIdentifier
impl Clone for BlockIdentifier
Source§fn clone(&self) -> BlockIdentifier
fn clone(&self) -> BlockIdentifier
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 BlockIdentifier
impl Debug for BlockIdentifier
Source§impl Display for BlockIdentifier
impl Display for BlockIdentifier
Source§impl Hash for BlockIdentifier
impl Hash for BlockIdentifier
Source§impl PartialEq for BlockIdentifier
impl PartialEq for BlockIdentifier
impl Eq for BlockIdentifier
impl StructuralPartialEq for BlockIdentifier
Auto Trait Implementations§
impl !Freeze for BlockIdentifier
impl RefUnwindSafe for BlockIdentifier
impl Send for BlockIdentifier
impl Sync for BlockIdentifier
impl Unpin for BlockIdentifier
impl UnwindSafe for BlockIdentifier
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.