Skip to main content

AgentNode

Struct AgentNode 

Source
pub struct AgentNode<A, S>
where A: Agent + 'static, S: GraphStateTrait, S::Update: Default,
{ /* private fields */ }
Expand description

使用 Agent 适配为图节点的占位实现。

当前版本中,AgentNode 只负责调用底层 Agent,并丢弃结果,返回 Default::default() 作为状态增量,以保证编译通过。 未来版本会扩展为可配置的输入/输出映射逻辑。

Implementations§

Source§

impl<A, S> AgentNode<A, S>
where A: Agent + 'static, S: GraphStateTrait, S::Update: Default,

Source

pub fn new(agent: A) -> Self

Trait Implementations§

Source§

impl<A, S> GraphNode<S> for AgentNode<A, S>
where A: Agent + 'static, S: GraphStateTrait, S::Update: Default,

Source§

fn run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 S, _ctx: &'life2 mut NodeContext, ) -> Pin<Box<dyn Future<Output = Result<S::Update>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Auto Trait Implementations§

§

impl<A, S> Freeze for AgentNode<A, S>
where <S as GraphStateTrait>::Update: Sized,

§

impl<A, S> RefUnwindSafe for AgentNode<A, S>

§

impl<A, S> Send for AgentNode<A, S>
where <S as GraphStateTrait>::Update: Sized,

§

impl<A, S> Sync for AgentNode<A, S>
where <S as GraphStateTrait>::Update: Sized,

§

impl<A, S> Unpin for AgentNode<A, S>
where <S as GraphStateTrait>::Update: Sized, S: Unpin,

§

impl<A, S> UnsafeUnpin for AgentNode<A, S>
where <S as GraphStateTrait>::Update: Sized,

§

impl<A, S> UnwindSafe for AgentNode<A, S>

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> 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.