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.
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.