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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.