pub struct ResponseStream { /* private fields */ }Available on crate feature
server only.Expand description
A method result that is produced in parts.
Return it from a method registered with
RpcModule::register_streaming_method.
Implementations§
Source§impl ResponseStream
impl ResponseStream
Sourcepub fn new<F, Fut, E>(producer: F) -> Self
pub fn new<F, Fut, E>(producer: F) -> Self
Creates a result that producer sends in parts through the given sink.
The parts are concatenated as they are, so together they must form the result as one JSON
value. The transport polls the future while it sends the response and drops it with the
response. The result is complete once the future returns Ok and fails with the error it
returns or when it panics.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ResponseStream
impl !Sync for ResponseStream
impl !UnwindSafe for ResponseStream
impl Forget for ResponseStream
impl Freeze for ResponseStream
impl Move for ResponseStream
impl Send for ResponseStream
impl Unpin for ResponseStream
impl UnsafeUnpin for ResponseStream
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes