pub struct TreeEngine<S> { /* private fields */ }Expand description
Engine for loading and ticking a tree.
Implementations§
Source§impl TreeEngine<Configured>
impl TreeEngine<Configured>
Sourcepub fn new(config: TreeEngineConfig) -> Self
pub fn new(config: TreeEngineConfig) -> Self
Creates a new engine in the Configured state.
Sourcepub fn register_action<B>(
&self,
behavior: B,
) -> Action<TaskRegistry, TaskHandle, B>where
B: ActionBehavior + 'static,
pub fn register_action<B>(
&self,
behavior: B,
) -> Action<TaskRegistry, TaskHandle, B>where
B: ActionBehavior + 'static,
Registers an action defined by a custom ActionBehavior.
Each action must be registered with the TreeEngine before it can be
inserted into a Tree. In other words, all action nodes used by a
Tree instance must be registered first.
Sourcepub fn tree<N>(self, tree: Tree<N>) -> TreeEngine<TreeLoaded<N>>where
N: Node,
pub fn tree<N>(self, tree: Tree<N>) -> TreeEngine<TreeLoaded<N>>where
N: Node,
Attaches an already constructed tree and returns an engine in the
TreeLoaded state.
Source§impl<N> TreeEngine<TreeLoaded<N>>where
N: Node,
impl<N> TreeEngine<TreeLoaded<N>>where
N: Node,
Sourcepub fn start_executor(self) -> Result<TreeEngine<Runnable<N>>>
pub fn start_executor(self) -> Result<TreeEngine<Runnable<N>>>
Starts the executor and transitions the engine into the Runnable
state.
Source§impl<N> TreeEngine<Runnable<N>>where
N: Node,
impl<N> TreeEngine<Runnable<N>>where
N: Node,
Sourcepub async fn tick_till_terminal<S>(
&mut self,
ticker: Ticker<S>,
) -> Result<TickStatus, Error>
pub async fn tick_till_terminal<S>( &mut self, ticker: Ticker<S>, ) -> Result<TickStatus, Error>
Ticks the tree until it reaches a terminal status, then resets the tree before returning that status.
Auto Trait Implementations§
impl<S> Freeze for TreeEngine<S>where
S: Freeze,
impl<S> RefUnwindSafe for TreeEngine<S>where
S: RefUnwindSafe,
impl<S> Send for TreeEngine<S>where
S: Send,
impl<S> Sync for TreeEngine<S>where
S: Sync,
impl<S> Unpin for TreeEngine<S>where
S: Unpin,
impl<S> UnsafeUnpin for TreeEngine<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for TreeEngine<S>where
S: UnwindSafe,
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