Trait penumbra_tct::storage::Read
source · pub trait Read {
type Error;
type HashesIter<'a>: Iterator<Item = Result<(Position, u8, Hash), Self::Error>> + 'a
where Self: 'a;
type CommitmentsIter<'a>: Iterator<Item = Result<(Position, StateCommitment), Self::Error>> + 'a
where Self: 'a;
// Required methods
fn position(&mut self) -> Result<StoredPosition, Self::Error>;
fn forgotten(&mut self) -> Result<Forgotten, Self::Error>;
fn hash(
&mut self,
position: Position,
height: u8
) -> Result<Option<Hash>, Self::Error>;
fn hashes(&mut self) -> Self::HashesIter<'_>;
fn commitment(
&mut self,
position: Position
) -> Result<Option<StateCommitment>, Self::Error>;
fn commitments(&mut self) -> Self::CommitmentsIter<'_>;
}
Expand description
Required Associated Types§
sourcetype HashesIter<'a>: Iterator<Item = Result<(Position, u8, Hash), Self::Error>> + 'a
where
Self: 'a
type HashesIter<'a>: Iterator<Item = Result<(Position, u8, Hash), Self::Error>> + 'a where Self: 'a
The type of iterator returned when reading hashes from the database.
sourcetype CommitmentsIter<'a>: Iterator<Item = Result<(Position, StateCommitment), Self::Error>> + 'a
where
Self: 'a
type CommitmentsIter<'a>: Iterator<Item = Result<(Position, StateCommitment), Self::Error>> + 'a where Self: 'a
The type of iterator returned when reading commitments from the database.
Required Methods§
sourcefn position(&mut self) -> Result<StoredPosition, Self::Error>
fn position(&mut self) -> Result<StoredPosition, Self::Error>
Fetch the current position stored.
sourcefn hash(
&mut self,
position: Position,
height: u8
) -> Result<Option<Hash>, Self::Error>
fn hash( &mut self, position: Position, height: u8 ) -> Result<Option<Hash>, Self::Error>
Fetch a specific hash at the given position and height, if it exists.
sourcefn hashes(&mut self) -> Self::HashesIter<'_>
fn hashes(&mut self) -> Self::HashesIter<'_>
Get the full list of all internal hashes stored, indexed by position and height.
sourcefn commitment(
&mut self,
position: Position
) -> Result<Option<StateCommitment>, Self::Error>
fn commitment( &mut self, position: Position ) -> Result<Option<StateCommitment>, Self::Error>
Fetch a specific commitment at the given position, if it exists.
sourcefn commitments(&mut self) -> Self::CommitmentsIter<'_>
fn commitments(&mut self) -> Self::CommitmentsIter<'_>
Get the full list of all commitments stored, indexed by position.
Object Safety§
This trait is not object safe.