pub trait SeqAccess: Send {
type Error: Error;
// Required method
fn next_element<'life0, 'async_trait, T>(
&'life0 mut self,
context: T::Context
) -> Pin<Box<dyn Future<Output = Result<Option<T>, Self::Error>> + Send + 'async_trait>>
where T: 'async_trait + FromStream,
Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn expect_next<'life0, 'async_trait, T>(
&'life0 mut self,
context: T::Context
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_trait>>
where T: 'async_trait + FromStream,
Self: 'async_trait,
'life0: 'async_trait { ... }
fn size_hint(&self) -> Option<usize> { ... }
}
Expand description
Required Associated Types§
Required Methods§
sourcefn next_element<'life0, 'async_trait, T>(
&'life0 mut self,
context: T::Context
) -> Pin<Box<dyn Future<Output = Result<Option<T>, Self::Error>> + Send + 'async_trait>>where
T: 'async_trait + FromStream,
Self: 'async_trait,
'life0: 'async_trait,
fn next_element<'life0, 'async_trait, T>(
&'life0 mut self,
context: T::Context
) -> Pin<Box<dyn Future<Output = Result<Option<T>, Self::Error>> + Send + 'async_trait>>where
T: 'async_trait + FromStream,
Self: 'async_trait,
'life0: 'async_trait,
Returns Ok(Some(value))
for the next value in the sequence,
or Ok(None)
if there is no next item of type T
.
context
is the decoder context used by T
’s FromStream
impl.
If T
is small enough to fit in main memory, pass the unit context ()
.
Provided Methods§
sourcefn expect_next<'life0, 'async_trait, T>(
&'life0 mut self,
context: T::Context
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_trait>>where
T: 'async_trait + FromStream,
Self: 'async_trait,
'life0: 'async_trait,
fn expect_next<'life0, 'async_trait, T>(
&'life0 mut self,
context: T::Context
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_trait>>where
T: 'async_trait + FromStream,
Self: 'async_trait,
'life0: 'async_trait,
Returns Ok(Some(value))
for the next value in the sequence,
or an error if there is no next item or it’s not the required type.
context
is the decoder context used by T
’s FromStream
impl.
If T
is small enough to fit in main memory, pass the unit context ()
.
Object Safety§
This trait is not object safe.