pub struct IndexId(/* private fields */);Expand description
A type used to associate two particular interesting Cone Root Indexes with a message in the Tangle, i.e. the Oldest Cone Root Index (OCRI), and the Youngest Cone Root Index (YCRI)
Implementations§
Source§impl IndexId
impl IndexId
Sourcepub fn new(index: MilestoneIndex, id: MessageId) -> Self
pub fn new(index: MilestoneIndex, id: MessageId) -> Self
Create a new IndexId.
Sourcepub fn index(&self) -> MilestoneIndex
pub fn index(&self) -> MilestoneIndex
Get the milestone index of this IndexId.
Sourcepub fn set_index(&mut self, index: MilestoneIndex)
pub fn set_index(&mut self, index: MilestoneIndex)
Update this IndexId with a new milestone index.
Trait Implementations§
Source§impl Ord for IndexId
impl Ord for IndexId
Source§impl Packable for IndexId
impl Packable for IndexId
Source§type Error = IndexIdError
type Error = IndexIdError
Associated error type.
Source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
Returns the length of the packed bytes.
Source§fn pack<W: Write>(&self, writer: &mut W) -> Result<(), Self::Error>
fn pack<W: Write>(&self, writer: &mut W) -> Result<(), Self::Error>
Packs the instance to bytes and writes them to the passed writer.
Source§fn unpack_inner<R: Read + ?Sized, const CHECK: bool>(
reader: &mut R,
) -> Result<Self, Self::Error>
fn unpack_inner<R: Read + ?Sized, const CHECK: bool>( reader: &mut R, ) -> Result<Self, Self::Error>
Reads bytes from the passed reader and unpacks them into an instance.
Source§fn pack_new(&self) -> Vec<u8> ⓘ
fn pack_new(&self) -> Vec<u8> ⓘ
Packs the instance to bytes and writes them to a newly allocated vector.
Source§impl PartialOrd for IndexId
impl PartialOrd for IndexId
impl Copy for IndexId
impl Eq for IndexId
Auto Trait Implementations§
impl Freeze for IndexId
impl RefUnwindSafe for IndexId
impl Send for IndexId
impl Sync for IndexId
impl Unpin for IndexId
impl UnwindSafe for IndexId
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