Skip to main content

AgentCompletionMap

Struct AgentCompletionMap 

Source
pub struct AgentCompletionMap { /* private fields */ }
Expand description

Frame-scoped map of agent completion handles.

Created by the scheduler at the top of each frame and inserted into the per-frame ServiceRegistry overlay. Agents must NOT retain a reference past the current frame.

Implementations§

Source§

impl AgentCompletionMap

Source

pub fn new(agent_ids: &[AgentId]) -> Self

Builds a completion map with one empty handle per agent ID.

Source

pub fn mark(&self, id: AgentId, outcome: CompletionOutcome) -> bool

Marks an agent as having finished this frame with the given outcome.

Idempotent: subsequent calls for the same agent are no-ops. Returns false if the agent ID is unknown to this map.

Source

pub fn outcome(&self, id: AgentId) -> Option<CompletionOutcome>

Returns the recorded outcome for id, or None if the agent has not yet been marked (or the ID is unknown).

Source

pub fn is_done(&self, id: AgentId) -> bool

Returns true if a mark has been recorded for id.

Source

pub async fn wait(&self, id: AgentId) -> Option<CompletionOutcome>

Awaits an agent’s completion. Returns the outcome, or None if the agent ID is unknown to this map (signals a configuration bug rather than blocking forever).

Source

pub fn known_ids(&self) -> impl Iterator<Item = AgentId> + '_

Returns all agent IDs tracked by this map (for tests / introspection).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AppLifecycle for T
where T: ?Sized,

Source§

fn on_start(&mut self, ctx: &mut dyn AppContext)

Called once after the backend is up but before the first update. Apps install their theme / fonts here.
Source§

fn on_exit(&mut self)

Called once when the window is closing. Persist state here.
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns a reference to the inner value as &dyn Any.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.