Trait penumbra_tct::storage::AsyncRead
source · pub trait AsyncRead {
type Error;
type HashesStream<'a>: Stream<Item = Result<(Position, u8, Hash), Self::Error>> + Unpin + 'a
where Self: 'a;
type CommitmentsStream<'a>: Stream<Item = Result<(Position, StateCommitment), Self::Error>> + Unpin + 'a
where Self: 'a;
// Required methods
fn position<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<StoredPosition, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn forgotten<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Forgotten, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn hash<'life0, 'async_trait>(
&'life0 mut self,
position: Position,
height: u8
) -> Pin<Box<dyn Future<Output = Result<Option<Hash>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn hashes(&mut self) -> Self::HashesStream<'_>;
fn commitment<'life0, 'async_trait>(
&'life0 mut self,
position: Position
) -> Pin<Box<dyn Future<Output = Result<Option<StateCommitment>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commitments(&mut self) -> Self::CommitmentsStream<'_>;
}
Expand description
Required Associated Types§
sourcetype HashesStream<'a>: Stream<Item = Result<(Position, u8, Hash), Self::Error>> + Unpin + 'a
where
Self: 'a
type HashesStream<'a>: Stream<Item = Result<(Position, u8, Hash), Self::Error>> + Unpin + 'a where Self: 'a
The type of stream returned by AsyncRead::hashes
.
sourcetype CommitmentsStream<'a>: Stream<Item = Result<(Position, StateCommitment), Self::Error>> + Unpin + 'a
where
Self: 'a
type CommitmentsStream<'a>: Stream<Item = Result<(Position, StateCommitment), Self::Error>> + Unpin + 'a where Self: 'a
The type of stream returned by AsyncRead::commitments
.
Required Methods§
sourcefn position<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<StoredPosition, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn position<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<StoredPosition, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch the current position stored.
sourcefn forgotten<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Forgotten, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn forgotten<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Forgotten, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch the current forgotten version.
sourcefn hash<'life0, 'async_trait>(
&'life0 mut self,
position: Position,
height: u8
) -> Pin<Box<dyn Future<Output = Result<Option<Hash>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn hash<'life0, 'async_trait>(
&'life0 mut self,
position: Position,
height: u8
) -> Pin<Box<dyn Future<Output = Result<Option<Hash>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch the hash at the given position and height, if it exists.
sourcefn hashes(&mut self) -> Self::HashesStream<'_>
fn hashes(&mut self) -> Self::HashesStream<'_>
Get the full list of all internal hashes stored, indexed by position and height.
sourcefn commitment<'life0, 'async_trait>(
&'life0 mut self,
position: Position
) -> Pin<Box<dyn Future<Output = Result<Option<StateCommitment>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commitment<'life0, 'async_trait>(
&'life0 mut self,
position: Position
) -> Pin<Box<dyn Future<Output = Result<Option<StateCommitment>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch the commitment at the given position, if it exists.
sourcefn commitments(&mut self) -> Self::CommitmentsStream<'_>
fn commitments(&mut self) -> Self::CommitmentsStream<'_>
Get the full list of all commitments stored, indexed by position.
Object Safety§
This trait is not object safe.