[−][src]Trait grin_chain::linked_list::ListIndex
Index supporting a list of (duplicate) entries per commitment. Each entry will be at a unique MMR pos.
Associated Types
Loading content...Required methods
pub fn list_key(&self, commit: Commitment) -> Vec<u8>
[src]
Construct a key for the list.
pub fn entry_key(&self, commit: Commitment, pos: u64) -> Vec<u8>
[src]
Construct a key for an individual entry in the list.
pub fn peek_pos(
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<<Self::Entry as ListIndexEntry>::Pos>, Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<<Self::Entry as ListIndexEntry>::Pos>, Error>
Peek the head of the list for the specified commitment.
pub fn push_pos(
&self,
batch: &Batch<'_>,
commit: Commitment,
new_pos: <Self::Entry as ListIndexEntry>::Pos
) -> Result<(), Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment,
new_pos: <Self::Entry as ListIndexEntry>::Pos
) -> Result<(), Error>
Push a pos onto the list for the specified commitment.
pub fn pop_pos(
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<<Self::Entry as ListIndexEntry>::Pos>, Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<<Self::Entry as ListIndexEntry>::Pos>, Error>
Pop a pos off the list for the specified commitment.
Provided methods
pub fn get_list(
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<Self::List>, Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<Self::List>, Error>
Returns either a "Single" with embedded "pos" or a "list" with "head" and "tail". Key is "prefix|commit". Note the key for an individual entry in the list is "prefix|commit|pos".
pub fn get_entry(
&self,
batch: &Batch<'_>,
commit: Commitment,
pos: u64
) -> Result<Option<Self::Entry>, Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment,
pos: u64
) -> Result<Option<Self::Entry>, Error>
Returns one of "head", "tail" or "middle" entry variants. Key is "prefix|commit|pos".
Implementors
impl<T> ListIndex for MultiIndex<T> where
T: PosEntry,
[src]
T: PosEntry,
type List = ListWrapper<T>
type Entry = ListEntry<T>
pub fn list_key(&self, commit: Commitment) -> Vec<u8>
[src]
pub fn entry_key(&self, commit: Commitment, pos: u64) -> Vec<u8>
[src]
pub fn peek_pos(
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<T>, Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<T>, Error>
pub fn push_pos(
&self,
batch: &Batch<'_>,
commit: Commitment,
new_pos: T
) -> Result<(), Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment,
new_pos: T
) -> Result<(), Error>
pub fn pop_pos(
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<T>, Error>
[src]
&self,
batch: &Batch<'_>,
commit: Commitment
) -> Result<Option<T>, Error>
Pop the head of the list. Returns the output_pos. Returns None if list was empty.