pub struct LedgerIndex(pub MilestoneIndex);
Expand description
A wrapper type to represent the current ledger index.
Tuple Fields§
§0: MilestoneIndex
Implementations§
Source§impl LedgerIndex
impl LedgerIndex
Sourcepub fn new(index: MilestoneIndex) -> Self
pub fn new(index: MilestoneIndex) -> Self
Creates a new LedgerIndex
.
Trait Implementations§
Source§impl Clone for LedgerIndex
impl Clone for LedgerIndex
Source§fn clone(&self) -> LedgerIndex
fn clone(&self) -> LedgerIndex
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 LedgerIndex
impl Debug for LedgerIndex
Source§impl Default for LedgerIndex
impl Default for LedgerIndex
Source§fn default() -> LedgerIndex
fn default() -> LedgerIndex
Returns the “default value” for a type. Read more
Source§impl Deref for LedgerIndex
impl Deref for LedgerIndex
Source§impl From<MilestoneIndex> for LedgerIndex
impl From<MilestoneIndex> for LedgerIndex
Source§fn from(index: MilestoneIndex) -> Self
fn from(index: MilestoneIndex) -> Self
Converts to this type from the input type.
Source§impl Hash for LedgerIndex
impl Hash for LedgerIndex
Source§impl Ord for LedgerIndex
impl Ord for LedgerIndex
Source§fn cmp(&self, other: &LedgerIndex) -> Ordering
fn cmp(&self, other: &LedgerIndex) -> 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 Packable for LedgerIndex
impl Packable for LedgerIndex
Source§type UnpackError = <MilestoneIndex as Packable>::UnpackError
type UnpackError = <MilestoneIndex as Packable>::UnpackError
The error type that can be returned if some semantic error occurs while unpacking. Read more
Source§type UnpackVisitor = <MilestoneIndex as Packable>::UnpackVisitor
type UnpackVisitor = <MilestoneIndex as Packable>::UnpackVisitor
FIXME: docs
Source§fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
Packs this value into the given
Packer
.Source§fn unpack<U: Unpacker, const VERIFY: bool>(
unpacker: &mut U,
visitor: &Self::UnpackVisitor,
) -> Result<Self, UnpackError<Self::UnpackError, U::Error>>
fn unpack<U: Unpacker, const VERIFY: bool>( unpacker: &mut U, visitor: &Self::UnpackVisitor, ) -> Result<Self, UnpackError<Self::UnpackError, U::Error>>
Unpacks this value from the given
Unpacker
. The VERIFY
generic parameter can be used to skip additional
syntactic checks.Source§impl PartialEq for LedgerIndex
impl PartialEq for LedgerIndex
Source§impl PartialOrd for LedgerIndex
impl PartialOrd for LedgerIndex
impl Copy for LedgerIndex
impl Eq for LedgerIndex
impl StructuralPartialEq for LedgerIndex
Auto Trait Implementations§
impl Freeze for LedgerIndex
impl RefUnwindSafe for LedgerIndex
impl Send for LedgerIndex
impl Sync for LedgerIndex
impl Unpin for LedgerIndex
impl UnwindSafe for LedgerIndex
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
Source§fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor,
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_verified<T>( bytes: T, visitor: &<P as Packable>::UnpackVisitor, ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>
].
Source§fn unpack_unverified<T>(
bytes: T,
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_unverified<T>( bytes: T, ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>
] skipping some syntatical checks.
Source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
Returns the length in bytes of the value after being packed. The returned value always matches the number of
bytes written using
pack
.