pub struct Height(/* private fields */);Expand description
Block height
Implementations§
Source§impl Height
impl Height
pub const ZERO: Height
pub const MAX: Height
pub const fn new(height: u32) -> Height
pub fn write(&self, path: &Path) -> Result<(), Error>
pub fn increment(&mut self)
pub fn incremented(self) -> Height
pub fn decrement(&mut self)
pub fn decremented(self) -> Option<Height>
pub fn is_zero(self) -> bool
pub fn is_not_zero(self) -> bool
pub fn left_before_next_diff_adj(self) -> u32
pub fn left_before_next_halving(self) -> u32
Trait Implementations§
Source§impl AddAssign<u64> for Height
impl AddAssign<u64> for Height
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+= operation. Read moreSource§impl AddAssign<usize> for Height
impl AddAssign<usize> for Height
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+= operation. Read moreSource§impl Bytes for Height
impl Bytes for Height
Source§impl CheckedSub for Height
impl CheckedSub for Height
Source§impl<'de> Deserialize<'de> for Height
impl<'de> Deserialize<'de> for Height
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Height, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Height, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Formattable for Height
impl Formattable for Height
Source§impl From<Height> for DifficultyEpoch
impl From<Height> for DifficultyEpoch
Source§fn from(value: Height) -> DifficultyEpoch
fn from(value: Height) -> DifficultyEpoch
Converts to this type from the input type.
Source§impl From<Height> for HalvingEpoch
impl From<Height> for HalvingEpoch
Source§fn from(value: Height) -> HalvingEpoch
fn from(value: Height) -> HalvingEpoch
Converts to this type from the input type.
Source§impl FromCoarserIndex<DifficultyEpoch> for Height
impl FromCoarserIndex<DifficultyEpoch> for Height
Source§fn min_from(coarser: DifficultyEpoch) -> usize
fn min_from(coarser: DifficultyEpoch) -> usize
Returns the minimum fine-grained index represented by the coarse index.
Source§fn max_from_(coarser: DifficultyEpoch) -> usize
fn max_from_(coarser: DifficultyEpoch) -> usize
Returns the maximum fine-grained index represented by the coarse index.
Note: May exceed actual data length - use
max_from for bounded results.Source§fn max_from(coarser: T, len: usize) -> usize
fn max_from(coarser: T, len: usize) -> usize
Returns the maximum fine-grained index, bounded by the data length.
Source§fn inclusive_range_from(coarser: T, len: usize) -> RangeInclusive<usize>where
T: Clone,
fn inclusive_range_from(coarser: T, len: usize) -> RangeInclusive<usize>where
T: Clone,
Returns the inclusive range of fine-grained indices for the coarse index.
Source§impl JsonSchema for Height
impl JsonSchema for Height
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Height
impl Ord for Height
Source§impl PartialOrd for Height
impl PartialOrd for Height
Source§impl Pco for Height
impl Pco for Height
type NumberType = <u32 as Pco>::NumberType
Source§impl PrintableIndex for Height
impl PrintableIndex for Height
Source§impl Serialize for Height
impl Serialize for Height
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Height
impl Eq for Height
impl StructuralPartialEq for Height
impl TransparentPco<<u32 as Pco>::NumberType> for Height
Auto Trait Implementations§
impl Freeze for Height
impl RefUnwindSafe for Height
impl Send for Height
impl Sync for Height
impl Unpin for Height
impl UnwindSafe for Height
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromInnerSlice<<T as Pco>::NumberType> for Twhere
T: PcoVecValue,
impl<T> FromInnerSlice<<T as Pco>::NumberType> for Twhere
T: PcoVecValue,
const _SIZE_CHECK: ()
const _ALIGN_CHECK: ()
fn from_inner_slice(vec: Vec<<T as Pco>::NumberType>) -> Vec<T>
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