pub struct IndexList(/* private fields */);Implementations§
Source§impl IndexList
impl IndexList
Sourcepub fn try_from_bytes(bytes: &[u8]) -> Option<Self>
pub fn try_from_bytes(bytes: &[u8]) -> Option<Self>
Try to parse bytes into a list of indices
Sourcepub fn combine(&mut self, other: Self)
pub fn combine(&mut self, other: Self)
Given two index sets, produce a new index set modifying self in-place.
We assume self is synced ahead of other. The intersection of
the indices up to the common block height is kept along with all
indices of self with block height greater than other’s maximum
block height.
Sourcepub fn contains(&self, index: &Index) -> bool
pub fn contains(&self, index: &Index) -> bool
Check if an index is contained in self
Assumes self is sorted.
Sourcepub fn contains_height(&self, height: u64) -> bool
pub fn contains_height(&self, height: u64) -> bool
Check if the index set contains a given height.
Assumes self is sorted.
Trait Implementations§
Source§impl BorshDeserialize for IndexList
impl BorshDeserialize for IndexList
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for IndexList
impl BorshSerialize for IndexList
Source§impl<'de> Deserialize<'de> for IndexList
impl<'de> Deserialize<'de> for IndexList
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 FromIterator<Index> for IndexList
impl FromIterator<Index> for IndexList
Source§impl IntoIterator for IndexList
impl IntoIterator for IndexList
impl Eq for IndexList
impl StructuralPartialEq for IndexList
Auto Trait Implementations§
impl Freeze for IndexList
impl RefUnwindSafe for IndexList
impl Send for IndexList
impl Sync for IndexList
impl Unpin for IndexList
impl UnwindSafe for IndexList
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