pub struct BehaviorInterruptTrigger { /* private fields */ }Expand description
Reusable behavior interrupt trigger
This trigger can be embedded in any node that needs to interrupt behavior tree execution. It handles the complexity of auto-resume, timeouts, and completion detection.
Implementations§
Source§impl BehaviorInterruptTrigger
impl BehaviorInterruptTrigger
Sourcepub fn new(source: &str, config: BehaviorInterruptConfig) -> Self
pub fn new(source: &str, config: BehaviorInterruptConfig) -> Self
Create a new behavior interrupt trigger
Sourcepub async fn interrupt(&mut self, ctx: &Context) -> Result<()>
pub async fn interrupt(&mut self, ctx: &Context) -> Result<()>
Interrupt behavior tree execution
Sends an interrupt command to the behavior executor. If auto-resume is enabled, schedules automatic resume after timeout.
Sourcepub async fn resume(&mut self, ctx: &Context) -> Result<()>
pub async fn resume(&mut self, ctx: &Context) -> Result<()>
Resume behavior tree execution
Sends a resume command to the behavior executor. Cancels any pending auto-resume task.
Sourcepub fn interrupt_duration(&self) -> Option<Duration>
pub fn interrupt_duration(&self) -> Option<Duration>
Get interrupt duration (time since interrupt was triggered)
Sourcepub fn is_interrupted(&self) -> bool
pub fn is_interrupted(&self) -> bool
Check if currently interrupted
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BehaviorInterruptTrigger
impl RefUnwindSafe for BehaviorInterruptTrigger
impl Send for BehaviorInterruptTrigger
impl Sync for BehaviorInterruptTrigger
impl Unpin for BehaviorInterruptTrigger
impl UnwindSafe for BehaviorInterruptTrigger
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