bonsai_bt/
status.rs

1#[cfg(feature = "serde")]
2use serde::{Deserialize, Serialize};
3
4/// The result of a behavior or action.
5///
6/// A tree node that receives a tick signal executes it's callback. The callback
7/// must return either:
8/// * Success
9/// * Failure or
10/// * Running, if the action is asynchronous and it needs more time to complete
11#[derive(Copy, Clone, PartialEq, Eq, Debug)]
12#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13pub enum Status {
14    /// The behavior or action succeeded.
15    Success,
16    /// The behavior or action failed.
17    Failure,
18    /// The behavior or action is still running.
19    ///
20    /// 'Running' is usually returned by nodes that has long-
21    /// running operations (e.g NavigatetoGoal, CountToHundred) and nodes
22    /// that has operations that are everlasting (e.g ComputePI, AvoidObstacles)
23    /// with no clear definition of an end-state
24    Running,
25}