pub struct ShellEvents { /* private fields */ }Expand description
The events of one or several shells, and where they are read.
Cloning shares the queues: an event goes to one of the clones that read. A
handle owns both halves of its queues, so they never close: recv
waits for as long as the embedder keeps the handle.
A shell built with a handle raises its events on it, and so does every subagent shell it launches.
Implementations§
Source§impl ShellEvents
impl ShellEvents
Sourcepub fn try_recv(&self) -> Option<ShellEvent>
pub fn try_recv(&self) -> Option<ShellEvent>
The next event already raised, without waiting.
Sourcepub async fn recv(&self) -> ShellEvent
pub async fn recv(&self) -> ShellEvent
Waits for the next event.
Cancel-safe: an event is taken only when this future completes, so a caller racing it against other work loses nothing.
§Panics
Never in practice: the handle holds the senders of its own queues, so they cannot close.
Sourcepub async fn recv_timeout(&self, duration: Duration) -> Option<ShellEvent>
pub async fn recv_timeout(&self, duration: Duration) -> Option<ShellEvent>
Waits for the next event, for at most duration.
Trait Implementations§
Source§impl Clone for ShellEvents
impl Clone for ShellEvents
Source§impl Debug for ShellEvents
impl Debug for ShellEvents
Auto Trait Implementations§
impl !Unpin for ShellEvents
impl !UnsafeUnpin for ShellEvents
impl Forget for ShellEvents
impl Freeze for ShellEvents
impl Move for ShellEvents
impl RefUnwindSafe for ShellEvents
impl Send for ShellEvents
impl Sync for ShellEvents
impl UnwindSafe for ShellEvents
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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