#[repr(C)]pub struct MempoolEntries {
pub counts: [u16; 256],
pub entries: [[MempoolEntry; 100]; 256],
}
Fields§
§counts: [u16; 256]
§entries: [[MempoolEntry; 100]; 256]
Implementations§
Source§impl MempoolEntries
impl MempoolEntries
pub fn get(&self, txid: &Txid) -> Option<&MempoolEntry>
pub fn iter(&self) -> impl Iterator<Item = &MempoolEntry>
pub fn keys(&self) -> impl Iterator<Item = &Txid>
pub fn contains_key(&self, txid: &Txid) -> bool
pub fn extend(&mut self, other: Self)
Sourcepub fn add_entry(&mut self, entry: MempoolEntry)
pub fn add_entry(&mut self, entry: MempoolEntry)
Adds a new entry. If there’s already an entry with this txid, it’s replaced. If there’s no space left in the bucket, the oldest entry is overwritten.
Sourcepub fn remove_entry(&mut self, txid: Txid)
pub fn remove_entry(&mut self, txid: Txid)
Removes an entry with the specified txid
Sourcepub fn update_entry(&mut self, entry: MempoolEntry)
pub fn update_entry(&mut self, entry: MempoolEntry)
Updates an existing entry or adds a new one
Sourcepub fn deserialize_from_slice(
data: &[u8],
) -> Result<HashMap<Txid, MempoolEntry>>
pub fn deserialize_from_slice( data: &[u8], ) -> Result<HashMap<Txid, MempoolEntry>>
Deserializes a MempoolEntries struct from a slice of bytes
Trait Implementations§
Source§impl BorshDeserialize for MempoolEntries
impl BorshDeserialize for MempoolEntries
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 MempoolEntries
impl BorshSerialize for MempoolEntries
Source§impl Clone for MempoolEntries
impl Clone for MempoolEntries
Source§fn clone(&self) -> MempoolEntries
fn clone(&self) -> MempoolEntries
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 MempoolEntries
impl Debug for MempoolEntries
Source§impl<'de> Deserialize<'de> for MempoolEntries
impl<'de> Deserialize<'de> for MempoolEntries
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
Auto Trait Implementations§
impl Freeze for MempoolEntries
impl RefUnwindSafe for MempoolEntries
impl Send for MempoolEntries
impl Sync for MempoolEntries
impl Unpin for MempoolEntries
impl UnwindSafe for MempoolEntries
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