pub struct BlockHeight { /* private fields */ }Expand description
BlockHeight is the height of a block, measured as the number of blocks since the genesis of the chain. The first block of transactions is at height 0. It is signed to prevent overflows in calculations.
Implementations§
Source§impl BlockHeight
impl BlockHeight
pub fn into_inner(self) -> i64
pub const fn new(_inner: i64) -> BlockHeight
Source§impl BlockHeight
impl BlockHeight
Sourcepub fn checked_add(&self, blocks: i64) -> Option<BlockHeight>
pub fn checked_add(&self, blocks: i64) -> Option<BlockHeight>
self + blocks, or None on overflow.
Sourcepub fn checked_sub(&self, blocks: i64) -> Option<BlockHeight>
pub fn checked_sub(&self, blocks: i64) -> Option<BlockHeight>
self - blocks, or None on overflow.
Sourcepub fn blocks_since(&self, earlier: &BlockHeight) -> i64
pub fn blocks_since(&self, earlier: &BlockHeight) -> i64
The blocks from earlier to self: negative if earlier is in fact
later.
The same as self - earlier. Panics if the difference overflows
i64; see checked_blocks_since.
Sourcepub fn checked_blocks_since(&self, earlier: &BlockHeight) -> Option<i64>
pub fn checked_blocks_since(&self, earlier: &BlockHeight) -> Option<i64>
The blocks from earlier to self, or None if the difference
overflows i64.
Trait Implementations§
Source§impl Add<i64> for &BlockHeight
impl Add<i64> for &BlockHeight
Source§type Output = BlockHeight
type Output = BlockHeight
The resulting type after applying the
+ operator.Source§impl Add<i64> for BlockHeight
impl Add<i64> for BlockHeight
Source§type Output = BlockHeight
type Output = BlockHeight
The resulting type after applying the
+ operator.Source§impl AddAssign<i64> for BlockHeight
impl AddAssign<i64> for BlockHeight
Source§fn add_assign(&mut self, rhs: i64)
fn add_assign(&mut self, rhs: i64)
Performs the
+= operation. Read moreSource§impl Clone for BlockHeight
impl Clone for BlockHeight
Source§fn clone(&self) -> BlockHeight
fn clone(&self) -> BlockHeight
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CollectAuthHandles for BlockHeight
impl CollectAuthHandles for BlockHeight
fn collect_auth_handles( &self, _out: &mut AuthHandleBuf, ) -> Result<(), FaultString>
Source§impl ConstMaxSize for BlockHeight
impl ConstMaxSize for BlockHeight
Source§impl ConstMaxSize for BlockHeight
impl ConstMaxSize for BlockHeight
Source§impl ContractTypeRefSpec for BlockHeight
impl ContractTypeRefSpec for BlockHeight
Source§const INFO: ContractTypeInfo<'static>
const INFO: ContractTypeInfo<'static>
The type reference. Transitive type definitions are not carried here;
they are retained via the linker-anchor mechanism
(
__THRUPUT_SPEC_ANCHOR_ROOT) and resolved by spec-tool.Source§const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
How this type appears as a signed-token preimage
(
ContractTypeView::SignedToken’s payload): the type itself by
default, or None for a type-erased payload (the SDK’s Opaque
overrides this).Source§impl Debug for BlockHeight
impl Debug for BlockHeight
Source§impl Deref for BlockHeight
impl Deref for BlockHeight
Source§impl DerefMut for BlockHeight
impl DerefMut for BlockHeight
impl EncodesAs<BlockHeight> for BlockHeight
impl Eq for BlockHeight
Source§impl From<i64> for BlockHeight
impl From<i64> for BlockHeight
Source§fn from(_inner: i64) -> BlockHeight
fn from(_inner: i64) -> BlockHeight
Converts to this type from the input type.
Source§impl Hash for BlockHeight
impl Hash for BlockHeight
Source§impl JsonSchema for BlockHeight
impl JsonSchema for BlockHeight
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 Mintable for BlockHeight
impl Mintable for BlockHeight
fn mint_into_parent(preimage: BlockHeight, _children: &mut ChildNodeBuf) -> Self
Source§impl MintableType for BlockHeight
impl MintableType for BlockHeight
type Preimage = BlockHeight
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 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for BlockHeight
impl PartialEq for BlockHeight
Source§impl PartialOrd for BlockHeight
impl PartialOrd for BlockHeight
Source§impl<'_r> ReadXDR<'_r> for BlockHeight
impl<'_r> ReadXDR<'_r> for BlockHeight
Source§fn read_xdr<R>(r: &mut R) -> Result<BlockHeight, ReadError>where
R: Reader<'_r>,
fn read_xdr<R>(r: &mut R) -> Result<BlockHeight, ReadError>where
R: Reader<'_r>,
Reads an XDR value from the reader. Read more
Source§fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, BlockHeight>,
) -> Result<Init<'__xdrs_s, BlockHeight>, ReadError>where
R: Reader<'_r>,
fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, BlockHeight>,
) -> Result<Init<'__xdrs_s, BlockHeight>, ReadError>where
R: Reader<'_r>,
Reads an XDR value directly into
slot, without first building it
on the stack. Read moreSource§impl ReceiveAuthHandles for BlockHeight
impl ReceiveAuthHandles for BlockHeight
fn receive_auth_handles( &mut self, _handles: &mut impl Iterator<Item = u32>, ) -> Result<(), AuthTokenError>
impl StructuralPartialEq for BlockHeight
Source§impl Sub for BlockHeight
impl Sub for BlockHeight
Source§impl Sub<&BlockHeight> for &BlockHeight
impl Sub<&BlockHeight> for &BlockHeight
Source§impl Sub<&BlockHeight> for BlockHeight
impl Sub<&BlockHeight> for BlockHeight
Source§impl Sub<BlockHeight> for &BlockHeight
impl Sub<BlockHeight> for &BlockHeight
Source§impl Sub<i64> for &BlockHeight
impl Sub<i64> for &BlockHeight
Source§type Output = BlockHeight
type Output = BlockHeight
The resulting type after applying the
- operator.Source§impl Sub<i64> for BlockHeight
impl Sub<i64> for BlockHeight
Source§type Output = BlockHeight
type Output = BlockHeight
The resulting type after applying the
- operator.Source§impl SubAssign<i64> for BlockHeight
impl SubAssign<i64> for BlockHeight
Source§fn sub_assign(&mut self, rhs: i64)
fn sub_assign(&mut self, rhs: i64)
Performs the
-= operation. Read moreSource§impl WriteXDR for BlockHeight
impl WriteXDR for BlockHeight
Source§fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
Writes this value as XDR data to the writer. Read more
Source§unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
Writes this value as XDR data to the writer, without runtime checks. Read more
Auto Trait Implementations§
impl Freeze for BlockHeight
impl RefUnwindSafe for BlockHeight
impl Send for BlockHeight
impl Sync for BlockHeight
impl Unpin for BlockHeight
impl UnsafeUnpin 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