pub struct AwaitableData<Buffer: Send + Sync>(/* private fields */);
Expand description
Awaitable
You must call wait()
and poll the return future to end, otherwise
the request/response id might be dropped early and
ReadEnd::read_in_one_packet_pinned
or
ReadEnd::read_in_one_packet
might fail due to unexpected
response id.
Alternatively, you can choose to ignore these errors, but it’s not recommended.
Implementations§
Source§impl<Buffer: Send + Sync> AwaitableData<Buffer>
impl<Buffer: Send + Sync> AwaitableData<Buffer>
Sourcepub fn wait(self) -> AwaitableDataFuture<Buffer> ⓘ
pub fn wait(self) -> AwaitableDataFuture<Buffer> ⓘ
Return (id, res).
id can be reused in the next request.
§Cancel Safety
It is perfectly safe to cancel the future.
Trait Implementations§
Auto Trait Implementations§
impl<Buffer> Freeze for AwaitableData<Buffer>
impl<Buffer> !RefUnwindSafe for AwaitableData<Buffer>
impl<Buffer> Send for AwaitableData<Buffer>
impl<Buffer> Sync for AwaitableData<Buffer>
impl<Buffer> Unpin for AwaitableData<Buffer>
impl<Buffer> !UnwindSafe for AwaitableData<Buffer>
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