pub struct PendingInteractions {
held: Vec<(String, PendingInteractionSlot)>,
}Expand description
The interactions a seat is parked on, oldest first.
Ordered because the read answers it, and the dock draws the front. Two AskUserQuestion calls in one assistant message run in parallel with different tool ids, so a seat can hold several at once, and the rule is first-parked-first-drawn. One Vec rather than a map and an order beside it: a seat holds a handful at most, and there is then no second structure to keep in step.
Fields§
§held: Vec<(String, PendingInteractionSlot)>Implementations§
Source§impl PendingInteractions
impl PendingInteractions
Sourcepub fn insert(&mut self, tool_id: String, slot: PendingInteractionSlot)
pub fn insert(&mut self, tool_id: String, slot: PendingInteractionSlot)
Park slot under tool_id. A repeat of an id replaces in place, so a
frame folded twice does not park the same interaction twice.
pub fn get(&self, tool_id: &str) -> Option<&PendingInteractionSlot>
pub fn remove(&mut self, tool_id: &str) -> Option<PendingInteractionSlot>
pub fn contains_key(&self, tool_id: &str) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn values(&self) -> impl Iterator<Item = &PendingInteractionSlot>
pub fn values(&self) -> impl Iterator<Item = &PendingInteractionSlot>
Oldest first.
Sourcepub fn drain(
&mut self,
) -> impl Iterator<Item = (String, PendingInteractionSlot)>
pub fn drain( &mut self, ) -> impl Iterator<Item = (String, PendingInteractionSlot)>
Oldest first, together with the ids that key them.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PendingInteractions
impl !UnwindSafe for PendingInteractions
impl Freeze for PendingInteractions
impl Send for PendingInteractions
impl Sync for PendingInteractions
impl Unpin for PendingInteractions
impl UnsafeUnpin for PendingInteractions
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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