pub struct BehaviorExecutor { /* private fields */ }Implementations§
Source§impl BehaviorExecutor
impl BehaviorExecutor
Sourcepub fn new(
behavior: Box<dyn BehaviorNode>,
tick_rate_hz: f32,
) -> BehaviorExecutor
pub fn new( behavior: Box<dyn BehaviorNode>, tick_rate_hz: f32, ) -> BehaviorExecutor
Create a new behavior executor for behavior, ticking at tick_rate_hz (e.g. 30.0).
pub fn with_max_ticks(self, max_ticks: usize) -> BehaviorExecutor
pub async fn init(&mut self, ctx: &Context) -> Result<(), Error>
Sourcepub async fn run_until_complete(
&mut self,
ctx: &Context,
) -> Result<(NodeStatus, ExecutionStats), Error>
pub async fn run_until_complete( &mut self, ctx: &Context, ) -> Result<(NodeStatus, ExecutionStats), Error>
Run the behavior until it completes (Success or Failure), ticking at the configured rate.
Returns the final status and execution statistics.
Sourcepub async fn run_for_duration(
&mut self,
ctx: &Context,
duration: Duration,
) -> Result<(NodeStatus, ExecutionStats), Error>
pub async fn run_for_duration( &mut self, ctx: &Context, duration: Duration, ) -> Result<(NodeStatus, ExecutionStats), Error>
Run the behavior for a fixed duration, ticking at the configured rate regardless of whether it completes.
pub async fn terminate(&mut self, ctx: &Context) -> Result<(), Error>
Auto Trait Implementations§
impl !RefUnwindSafe for BehaviorExecutor
impl !UnwindSafe for BehaviorExecutor
impl Freeze for BehaviorExecutor
impl Send for BehaviorExecutor
impl Sync for BehaviorExecutor
impl Unpin for BehaviorExecutor
impl UnsafeUnpin for BehaviorExecutor
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> 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