pub struct PendingFeaturesRecv<Io> { /* private fields */ }Expand description
Type state for an initiator stream which has sent and received the stream header.
To continue stream setup, call recv_features.
Implementations§
Source§impl<Io> PendingFeaturesRecv<Io>
impl<Io> PendingFeaturesRecv<Io>
Sourcepub fn header(&self) -> StreamHeader<'_>
pub fn header(&self) -> StreamHeader<'_>
The stream header contents as sent by the peer.
Sourcepub fn take_header(&mut self) -> StreamHeader<'static>
pub fn take_header(&mut self) -> StreamHeader<'static>
Extract the stream header contents as sent by the peer.
Source§impl<Io: AsyncBufRead + AsyncWrite + Unpin> PendingFeaturesRecv<Io>
impl<Io: AsyncBufRead + AsyncWrite + Unpin> PendingFeaturesRecv<Io>
Sourcepub async fn recv_features<T: FromXml + AsXml>(
self,
) -> Result<(StreamFeatures, XmlStream<Io, T>), RecvFeaturesError>
pub async fn recv_features<T: FromXml + AsXml>( self, ) -> Result<(StreamFeatures, XmlStream<Io, T>), RecvFeaturesError>
Receive the responder’s stream features.
After the stream features have been received, the stream can be used
for exchanging stream-level elements (stanzas or “nonzas”). The Rust
type for these elements must be given as type parameter T.
If the peer sends a stream error instead of features, the error is
returned as RecvFeaturesError::StreamError.
If the peer sends any payload which is neither stream features nor
a stream error, an io::Error with
InvalidData kind is returned.
Sourcepub fn skip_features<T: FromXml + AsXml>(self) -> XmlStream<Io, T>
pub fn skip_features<T: FromXml + AsXml>(self) -> XmlStream<Io, T>
Skip receiving the responder’s stream features.
The stream can be used for exchanging stream-level elements (stanzas
or “nonzas”). The Rust type for these elements must be given as type
parameter T.
Note: Using this on RFC 6120 compliant streams where stream features are sent after the stream header will cause a parse error down the road (because the feature stream element cannot be handled). The only place where this is useful is in XEP-0114 connections.
Auto Trait Implementations§
impl<Io> Freeze for PendingFeaturesRecv<Io>where
Io: Freeze,
impl<Io> !RefUnwindSafe for PendingFeaturesRecv<Io>
impl<Io> Send for PendingFeaturesRecv<Io>where
Io: Send,
impl<Io> Sync for PendingFeaturesRecv<Io>where
Io: Sync,
impl<Io> Unpin for PendingFeaturesRecv<Io>where
Io: Unpin,
impl<Io> UnsafeUnpin for PendingFeaturesRecv<Io>where
Io: UnsafeUnpin,
impl<Io> !UnwindSafe for PendingFeaturesRecv<Io>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more