Struct linera_base::data_types::BlockHeight
source · pub struct BlockHeight(pub u64);Expand description
A block height to identify blocks in a chain.
Tuple Fields§
§0: u64Implementations§
source§impl BlockHeight
impl BlockHeight
pub const ZERO: Self = _
pub const MAX: Self = _
pub fn try_add(self, other: Self) -> Result<Self, ArithmeticError>
pub fn try_add_one(self) -> Result<Self, ArithmeticError>
pub fn saturating_add(self, other: Self) -> Self
pub fn try_sub(self, other: Self) -> Result<Self, ArithmeticError>
pub fn try_sub_one(self) -> Result<Self, ArithmeticError>
pub fn saturating_sub(self, other: Self) -> Self
pub fn try_add_assign(&mut self, other: Self) -> Result<(), ArithmeticError>
pub fn try_add_assign_one(&mut self) -> Result<(), ArithmeticError>
pub fn saturating_add_assign(&mut self, other: Self)
pub fn try_sub_assign(&mut self, other: Self) -> Result<(), ArithmeticError>
pub fn saturating_mul(&self, other: u64) -> Self
pub fn try_mul(self, other: u64) -> Result<Self, ArithmeticError>
pub fn try_mul_assign(&mut self, other: u64) -> Result<(), ArithmeticError>
Trait Implementations§
source§impl Clone for BlockHeight
impl Clone for BlockHeight
source§fn clone(&self) -> BlockHeight
fn clone(&self) -> BlockHeight
Returns a copy 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 BlockHeight
impl Debug for BlockHeight
source§impl Default for BlockHeight
impl Default for BlockHeight
source§fn default() -> BlockHeight
fn default() -> BlockHeight
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for BlockHeight
impl<'de> Deserialize<'de> for BlockHeight
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for BlockHeight
impl Display for BlockHeight
source§impl From<BlockHeight> for u64
impl From<BlockHeight> for u64
source§fn from(value: BlockHeight) -> Self
fn from(value: BlockHeight) -> Self
Converts to this type from the input type.
source§impl From<u64> for BlockHeight
impl From<u64> for BlockHeight
source§impl FromStr for BlockHeight
impl FromStr for BlockHeight
source§impl Hash for BlockHeight
impl Hash for BlockHeight
source§impl InputType for BlockHeight
impl InputType for BlockHeight
§type RawValueType = BlockHeight
type RawValueType = BlockHeight
The raw type used for validator. Read more
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from
Value. None represents undefined.source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl Ord for BlockHeight
impl Ord for BlockHeight
source§fn cmp(&self, other: &BlockHeight) -> Ordering
fn cmp(&self, other: &BlockHeight) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl OutputType for BlockHeight
impl OutputType for BlockHeight
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 ContextSelectionSet<'life2>,
_field: &'life3 Positioned<Field>
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _: &'life1 ContextSelectionSet<'life2>, _field: &'life3 Positioned<Field> ) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Resolve an output value to
async_graphql::Value.source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl PartialEq for BlockHeight
impl PartialEq for BlockHeight
source§fn eq(&self, other: &BlockHeight) -> bool
fn eq(&self, other: &BlockHeight) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for BlockHeight
impl PartialOrd for BlockHeight
source§fn partial_cmp(&self, other: &BlockHeight) -> Option<Ordering>
fn partial_cmp(&self, other: &BlockHeight) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl ScalarType for BlockHeight
impl ScalarType for BlockHeight
source§impl Serialize for BlockHeight
impl Serialize for BlockHeight
source§impl TryInto<usize> for BlockHeight
impl TryInto<usize> for BlockHeight
§type Error = ArithmeticError
type Error = ArithmeticError
The type returned in the event of a conversion error.
impl Copy for BlockHeight
impl Eq for BlockHeight
impl StructuralEq for BlockHeight
impl StructuralPartialEq for BlockHeight
Auto Trait Implementations§
impl RefUnwindSafe for BlockHeight
impl Send for BlockHeight
impl Sync for BlockHeight
impl Unpin for BlockHeight
impl UnwindSafe for BlockHeight
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.