pub struct ActionSet<A>(/* private fields */);Expand description
A typed collection of actions for a specific phase.
ActionSet<A> is the return type of all AgentBehavior
hooks. It is the unit of composition: plugins can define named functions
that return ActionSet<A> combining multiple core actions, and callers
compose them with ActionSet::and.
[From<A> for ActionSet<A>] allows a single action to be returned anywhere
an ActionSet<A> is expected, and [From<AnyStateAction> for A] is
implemented for every phase action enum so state changes can be expressed
without explicit wrapping.
Implementations§
Trait Implementations§
Source§impl<A> Extend<A> for ActionSet<A>
impl<A> Extend<A> for ActionSet<A>
Source§fn extend<T: IntoIterator<Item = A>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = A>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<AfterInferenceAction> for ActionSet<AfterInferenceAction>
impl From<AfterInferenceAction> for ActionSet<AfterInferenceAction>
Source§fn from(a: AfterInferenceAction) -> Self
fn from(a: AfterInferenceAction) -> Self
Converts to this type from the input type.
Source§impl From<AfterToolExecuteAction> for ActionSet<AfterToolExecuteAction>
impl From<AfterToolExecuteAction> for ActionSet<AfterToolExecuteAction>
Source§fn from(a: AfterToolExecuteAction) -> Self
fn from(a: AfterToolExecuteAction) -> Self
Converts to this type from the input type.
Source§impl From<AnyStateAction> for ActionSet<AfterInferenceAction>
impl From<AnyStateAction> for ActionSet<AfterInferenceAction>
Source§fn from(sa: AnyStateAction) -> Self
fn from(sa: AnyStateAction) -> Self
Converts to this type from the input type.
Source§impl From<AnyStateAction> for ActionSet<AfterToolExecuteAction>
impl From<AnyStateAction> for ActionSet<AfterToolExecuteAction>
Source§fn from(sa: AnyStateAction) -> Self
fn from(sa: AnyStateAction) -> Self
Converts to this type from the input type.
Source§impl From<AnyStateAction> for ActionSet<BeforeInferenceAction>
impl From<AnyStateAction> for ActionSet<BeforeInferenceAction>
Source§fn from(sa: AnyStateAction) -> Self
fn from(sa: AnyStateAction) -> Self
Converts to this type from the input type.
Source§impl From<AnyStateAction> for ActionSet<BeforeToolExecuteAction>
impl From<AnyStateAction> for ActionSet<BeforeToolExecuteAction>
Source§fn from(sa: AnyStateAction) -> Self
fn from(sa: AnyStateAction) -> Self
Converts to this type from the input type.
Source§impl From<AnyStateAction> for ActionSet<LifecycleAction>
impl From<AnyStateAction> for ActionSet<LifecycleAction>
Source§fn from(sa: AnyStateAction) -> Self
fn from(sa: AnyStateAction) -> Self
Converts to this type from the input type.
Source§impl From<BeforeInferenceAction> for ActionSet<BeforeInferenceAction>
impl From<BeforeInferenceAction> for ActionSet<BeforeInferenceAction>
Source§fn from(a: BeforeInferenceAction) -> Self
fn from(a: BeforeInferenceAction) -> Self
Converts to this type from the input type.
Source§impl From<BeforeToolExecuteAction> for ActionSet<BeforeToolExecuteAction>
impl From<BeforeToolExecuteAction> for ActionSet<BeforeToolExecuteAction>
Source§fn from(a: BeforeToolExecuteAction) -> Self
fn from(a: BeforeToolExecuteAction) -> Self
Converts to this type from the input type.
Source§impl From<LifecycleAction> for ActionSet<LifecycleAction>
impl From<LifecycleAction> for ActionSet<LifecycleAction>
Source§fn from(a: LifecycleAction) -> Self
fn from(a: LifecycleAction) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<A> Freeze for ActionSet<A>
impl<A> RefUnwindSafe for ActionSet<A>where
A: RefUnwindSafe,
impl<A> Send for ActionSet<A>where
A: Send,
impl<A> Sync for ActionSet<A>where
A: Sync,
impl<A> Unpin for ActionSet<A>where
A: Unpin,
impl<A> UnsafeUnpin for ActionSet<A>
impl<A> UnwindSafe for ActionSet<A>where
A: UnwindSafe,
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