pub struct CallResult<R> { /* private fields */ }Expand description
A completed call’s response and possible trailer.
Use into_response when the trailer is not needed,
or into_response_trailer to retain it —
or into_response_trailer_manual_credit
to retain it and take charge of returning its credit.
Implementations§
Source§impl<R> CallResult<R>
impl<R> CallResult<R>
Sourcepub fn take_payload_credit(&mut self) -> PayloadCredit
pub fn take_payload_credit(&mut self) -> PayloadCredit
Takes charge of releasing this call response’s payload quota.
Calling this more than once yields a token that releases nothing.
Sourcepub fn into_response(self) -> R
pub fn into_response(self) -> R
Discards any response trailer and returns just the response.
Sourcepub fn into_response_trailer(self) -> (R, Option<TrailerRecv>)
pub fn into_response_trailer(self) -> (R, Option<TrailerRecv>)
Decomposes into the response and its readable trailer, if present.
Sourcepub fn into_response_trailer_manual_credit(self) -> (R, Option<TrailerRecv>)
pub fn into_response_trailer_manual_credit(self) -> (R, Option<TrailerRecv>)
Decomposes into the response and its trailer in manual-credit mode.
The consumer then owes the server an explicit
TrailerRecv::release for
every chunk it finishes using, instead of credit being returned on
read.
Auto Trait Implementations§
impl<R> !RefUnwindSafe for CallResult<R>
impl<R> !UnwindSafe for CallResult<R>
impl<R> Freeze for CallResult<R>where
R: Freeze,
impl<R> Send for CallResult<R>where
R: Send,
impl<R> Sync for CallResult<R>where
R: Sync,
impl<R> Unpin for CallResult<R>where
R: Unpin,
impl<R> UnsafeUnpin for CallResult<R>where
R: 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