pub struct Opened<F> { /* private fields */ }Expand description
One reply a transport opened: its frames, and the facts the transport owns.
Implementations§
Source§impl<F: WasmCompatSend + 'static> Opened<F>
impl<F: WasmCompatSend + 'static> Opened<F>
Sourcepub fn new(
frames: impl Stream<Item = Result<F, ProviderError>> + WasmCompatSend + 'static,
) -> Self
pub fn new( frames: impl Stream<Item = Result<F, ProviderError>> + WasmCompatSend + 'static, ) -> Self
A reply of frames, in order. A transport failure is the last item.
Sourcepub fn failed(error: ProviderError) -> Self
pub fn failed(error: ProviderError) -> Self
A reply that failed with error before any frame.
Sourcepub fn with_request_id(self, request_id: Option<String>) -> Self
pub fn with_request_id(self, request_id: Option<String>) -> Self
The provider’s transport request id, when the reply carried one. An empty id is no id.
Sourcepub fn with_http(self, status: StatusCode, headers: HeaderMap) -> Self
pub fn with_http(self, status: StatusCode, headers: HeaderMap) -> Self
The reply’s HTTP status and headers, which enrich its unary failure.
Sourcepub fn with_route(self, route: impl Into<String>) -> Self
pub fn with_route(self, route: impl Into<String>) -> Self
The concrete request path, which a listing’s failure names.
Sourcepub fn with_document(self, document: Value) -> Self
pub fn with_document(self, document: Value) -> Self
The whole reply as one document: the response’s raw. A reply
with one is not fed to the wire’s reassembler.
Sourcepub fn map_frames<S>(
self,
frames: impl FnOnce(WasmBoxedStream<'static, Result<F, ProviderError>>) -> S,
) -> Self
pub fn map_frames<S>( self, frames: impl FnOnce(WasmBoxedStream<'static, Result<F, ProviderError>>) -> S, ) -> Self
The same reply, its frames passed through frames: what a transport
that wraps another uses to watch or rewrite a reply in flight.
Auto Trait Implementations§
impl<F> !RefUnwindSafe for Opened<F>
impl<F> !Sync for Opened<F>
impl<F> !UnwindSafe for Opened<F>
impl<F> Freeze for Opened<F>
impl<F> Send for Opened<F>
impl<F> Unpin for Opened<F>
impl<F> UnsafeUnpin for Opened<F>where
Pin<Box<dyn Stream<Item = Result<F, ProviderError>> + Send>>: UnsafeUnpin,
Option<fn(&F) -> bool>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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