Struct grpc::SingleResponse
source · pub struct SingleResponse<T: Send + 'static>(pub GrpcFuture<(Metadata, GrpcFuture<(T, Metadata)>)>);
Expand description
Single message response
Tuple Fields
0: GrpcFuture<(Metadata, GrpcFuture<(T, Metadata)>)>
Implementations
sourceimpl<T: Send + 'static> SingleResponse<T>
impl<T: Send + 'static> SingleResponse<T>
pub fn new<F>(f: F) -> SingleResponse<T>where
F: Future<Item = (Metadata, GrpcFuture<(T, Metadata)>), Error = Error> + Send + 'static,
pub fn metadata_and_future<F>(metadata: Metadata, result: F) -> SingleResponse<T>where
F: Future<Item = T, Error = Error> + Send + 'static,
pub fn metadata_and_future_and_trailing_metadata<F, M>(
metadata: Metadata,
result: F,
trailing: M
) -> SingleResponse<T>where
F: Future<Item = T, Error = Error> + Send + 'static,
M: Future<Item = Metadata, Error = Error> + Send + 'static,
pub fn completed_with_metadata_and_trailing_metadata(
metadata: Metadata,
r: T,
trailing: Metadata
) -> SingleResponse<T>
pub fn completed_with_metadata(metadata: Metadata, r: T) -> SingleResponse<T>
pub fn completed(r: T) -> SingleResponse<T>
pub fn no_metadata<F>(r: F) -> SingleResponse<T>where
F: Future<Item = T, Error = Error> + Send + 'static,
pub fn err(err: Error) -> SingleResponse<T>
pub fn join_metadata_result(self) -> GrpcFuture<(Metadata, T, Metadata)>
pub fn drop_metadata(self) -> GrpcFuture<T>
sourcepub fn into_stream(self) -> StreamingResponse<T>
pub fn into_stream(self) -> StreamingResponse<T>
Convert self into single element stream.
pub fn wait(self) -> Result<(Metadata, T, Metadata)>
pub fn wait_drop_metadata(self) -> Result<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for SingleResponse<T>
impl<T> Send for SingleResponse<T>
impl<T> !Sync for SingleResponse<T>
impl<T> Unpin for SingleResponse<T>
impl<T> !UnwindSafe for SingleResponse<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more