Expand description
§Beetry Core
This crate is an internal Beetry implementation crate and is not considered
part of the public API. For public APIs, use the beetry crate.
beetry-core defines foundational behavior tree framework traits and
concepts.
Node: the trait every executable tree node implementsTicker: a driver that advances a tree from an external tick sourceConditionBehavior: the behavior contract used byConditionleaf nodesActionBehavior: the behavior contract used byActionleaf nodes
§Node
Node is the central runtime trait in Beetry. Every control node,
decorator, condition, action, or whole tree is ultimately driven through the
same interface. This keeps the tree runtime uniform: composite nodes can
schedule children without needing a different protocol from leaf nodes, and
higher-level drivers only need to understand the node lifecycle.
§Ticker
Ticker ticks a tree from an external tick source.
Because Ticker can be built from a custom stream, each application can
define its own ticking mechanism without changing the tree implementation.
§Leaf behavior concepts
§Condition
ConditionBehavior is the minimal synchronous leaf contract. It is used
by Condition, which wraps the behavior and maps its condition evaluation
to TickStatus::Success or TickStatus::Failure.
§Action
ActionBehavior is the asynchronous leaf contract used by Action.
Action wraps the behavior and uses it to construct an ActionTask
that can be registered with an executor instead of directly returning a
TickStatus from tick.
Note: Action abort is currently implemented as a blocking operation: it signals the executor to abort the task, then waits until the task reaches a terminal state.
Re-exports§
pub use leaf::Action;pub use leaf::ActionBehavior;pub use leaf::BoxActionBehavior;pub use leaf::BoxConditionBehavior;pub use leaf::Condition;pub use leaf::ConditionBehavior;
Modules§
Structs§
- Action
Task - User-provided task that defines work to be executed when ticking an action node.
- Periodic
Tick - Built-in periodic tick source. Useful as the default in most applications.
- Root
- Root node.
- Task
Description - Ticker
- Ticks a behavior tree using an external tick source.
- Tree
- Behavior tree rooted at a
Rootnode.
Enums§
- Task
Status - Tick
Status - Result of a single node tick.
- Ticker
Error - Errors that can occur while ticking a tree from a tick source.
Traits§
- Abort
Task - Executor
Concept - Node
- Runtime contract for executable behavior tree nodes.
- Query
Task - Register
Task - Task
- Task
Handle
Type Aliases§
- BoxNode
- Boxed type-erased
Node. - BoxTask
Future - NonEmpty
Nodes - Non-empty collection of nodes.
- Periodic
Ticker