pub struct ActionNodeData {
pub action_name: String,
pub target: Option<String>,
pub args: HashMap<String, String>,
pub discovery: Option<Value>,
}Expand description
ノードが保持する Action 情報
探索空間の各ノードは「どのアクションを実行すべきか」を保持する。
Action への変換が可能で、Manager が Worker に指示を出す際に使用する。
§設計意図
- Action ↔ Node の対称性: Action → Node(実行結果)、Node → Action(復元)
- 自動実行: ノード情報から Action を復元できるので、LLM 不要で実行可能
- discovery 保持: 実行結果の発見情報も保持
§Example
ⓘ
// MutationInput から ActionNodeData を生成
let node_data = ActionNodeData::from_input(&input);
// Action に変換して Worker に渡す
let action: Action = (&node_data).into();
worker.execute(action);Fields§
§action_name: Stringアクション名(例: “grep”, “read”)
target: Option<String>ターゲット(例: “src/auth.rs”)
args: HashMap<String, String>追加引数
discovery: Option<Value>発見情報(アクション実行結果)
Implementations§
Source§impl ActionNodeData
impl ActionNodeData
Sourcepub fn with_target(self, target: impl Into<String>) -> Self
pub fn with_target(self, target: impl Into<String>) -> Self
ターゲットを設定
Sourcepub fn with_discovery(self, discovery: Value) -> Self
pub fn with_discovery(self, discovery: Value) -> Self
発見情報を設定
Sourcepub fn from_input(input: &dyn MutationInput) -> Self
pub fn from_input(input: &dyn MutationInput) -> Self
MutationInput から ActionNodeData を生成
Trait Implementations§
Source§impl ActionExtractor for ActionNodeData
impl ActionExtractor for ActionNodeData
Source§impl Clone for ActionNodeData
impl Clone for ActionNodeData
Source§fn clone(&self) -> ActionNodeData
fn clone(&self) -> ActionNodeData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActionNodeData
impl Debug for ActionNodeData
Source§impl Default for ActionNodeData
impl Default for ActionNodeData
Source§fn default() -> ActionNodeData
fn default() -> ActionNodeData
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ActionNodeData
impl<'de> Deserialize<'de> for ActionNodeData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&ActionNodeData> for Action
ActionNodeData から Action への変換
impl From<&ActionNodeData> for Action
ActionNodeData から Action への変換
Source§fn from(data: &ActionNodeData) -> Self
fn from(data: &ActionNodeData) -> Self
Converts to this type from the input type.
Source§impl From<ActionNodeData> for Action
ActionNodeData から Action への変換(所有権移動版)
impl From<ActionNodeData> for Action
ActionNodeData から Action への変換(所有権移動版)
Source§fn from(data: ActionNodeData) -> Self
fn from(data: ActionNodeData) -> Self
Converts to this type from the input type.
Source§impl<E, S, R> MutationLogic<ActionNodeData, E, S, R> for RulesBasedMutation
impl<E, S, R> MutationLogic<ActionNodeData, E, S, R> for RulesBasedMutation
Source§fn interpret(
&self,
input: &dyn MutationInput,
_map: &GraphMap<ActionNodeData, E, S>,
_actions: &ActionsConfig,
rules: &R,
_stats: &SwarmStats,
) -> Vec<MapUpdate<ActionNodeData, E, S>>
fn interpret( &self, input: &dyn MutationInput, _map: &GraphMap<ActionNodeData, E, S>, _actions: &ActionsConfig, rules: &R, _stats: &SwarmStats, ) -> Vec<MapUpdate<ActionNodeData, E, S>>
入力を MapUpdate に変換 Read more
Source§fn initialize(
&self,
root_id: MapNodeId,
initial_contexts: &[&str],
rules: &R,
) -> Vec<MapUpdate<ActionNodeData, E, S>>
fn initialize( &self, root_id: MapNodeId, initial_contexts: &[&str], rules: &R, ) -> Vec<MapUpdate<ActionNodeData, E, S>>
初期ノードを展開
Source§fn create_node_data(&self, input: &dyn MutationInput) -> ActionNodeData
fn create_node_data(&self, input: &dyn MutationInput) -> ActionNodeData
ノードデータを生成
Source§fn create_edge_data(&self, _input: &dyn MutationInput) -> E
fn create_edge_data(&self, _input: &dyn MutationInput) -> E
エッジデータを生成
Source§fn initial_state(&self) -> S
fn initial_state(&self) -> S
初期状態を生成
Auto Trait Implementations§
impl Freeze for ActionNodeData
impl RefUnwindSafe for ActionNodeData
impl Send for ActionNodeData
impl Sync for ActionNodeData
impl Unpin for ActionNodeData
impl UnwindSafe for ActionNodeData
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
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