pub struct Query { /* private fields */ }Expand description
Handle to an in-flight query.
Dropping the handle implicitly cancels the query: the driver task removes the proto state machine on its next loop iteration so no further transmits fire against it.
Implementations§
Source§impl Query
impl Query
Sourcepub const fn handle(&self) -> QueryHandle
pub const fn handle(&self) -> QueryHandle
The underlying proto-layer QueryHandle for this query.
Sourcepub async fn next(&self) -> Option<QueryEvent>
pub async fn next(&self) -> Option<QueryEvent>
Wait for the next answer or terminal. Returns None once the terminal
has been delivered (single-consumer; subsequent calls report
end-of-stream) or the driver has dropped the query entry.
Borrow discipline: every interaction with inner.state is confined to a
short synchronous scope; the only .await (notify.listen()) runs after
the borrow is dropped at the closing } of the scope.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Query
impl !RefUnwindSafe for Query
impl !Send for Query
impl !Sync for Query
impl !UnwindSafe for Query
impl Unpin for Query
impl UnsafeUnpin for Query
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
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