pub struct BehaviorLoader { /* private fields */ }Implementations§
Source§impl BehaviorLoader
impl BehaviorLoader
Sourcepub fn new(registry: NodeRegistry) -> BehaviorLoader
pub fn new(registry: NodeRegistry) -> BehaviorLoader
Create a new behavior loader with the given node registry.
Sourcepub fn load(
&self,
config: &BehaviorConfig,
) -> Result<Box<dyn BehaviorNode>, Error>
pub fn load( &self, config: &BehaviorConfig, ) -> Result<Box<dyn BehaviorNode>, Error>
Load a behavior tree from a BehaviorConfig, recursively instantiating all nodes.
Sourcepub fn load_from_json(&self, json: &str) -> Result<Box<dyn BehaviorNode>, Error>
pub fn load_from_json(&self, json: &str) -> Result<Box<dyn BehaviorNode>, Error>
Load a behavior tree from a JSON string (parses then loads).
Sourcepub fn load_from_file(
&self,
path: impl AsRef<Path>,
) -> Result<Box<dyn BehaviorNode>, Error>
pub fn load_from_file( &self, path: impl AsRef<Path>, ) -> Result<Box<dyn BehaviorNode>, Error>
Load a behavior tree from a JSON file (reads then loads).
Sourcepub fn registry(&self) -> &NodeRegistry
pub fn registry(&self) -> &NodeRegistry
Get a reference to the underlying node registry.
Trait Implementations§
Source§impl Clone for BehaviorLoader
impl Clone for BehaviorLoader
Source§fn clone(&self) -> BehaviorLoader
fn clone(&self) -> BehaviorLoader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BehaviorLoader
impl RefUnwindSafe for BehaviorLoader
impl Send for BehaviorLoader
impl Sync for BehaviorLoader
impl Unpin for BehaviorLoader
impl UnsafeUnpin for BehaviorLoader
impl UnwindSafe for BehaviorLoader
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