pub struct TopNode {
pub node: HoudiniNode,
}
Expand description
A wrapper for HoudiniNode
with methods for cooking PDG.
Fields
node: HoudiniNode
Implementations
sourceimpl TopNode
impl TopNode
sourcepub fn cook_async<F>(&self, func: F) -> Result<()>where
F: FnMut(CookStep) -> Result<ControlFlow<bool>>,
pub fn cook_async<F>(&self, func: F) -> Result<()>where
F: FnMut(CookStep) -> Result<ControlFlow<bool>>,
Start cooking a TOP node asynchronously.
For each generated event, a user closure will be called with a CookStep
argument.
The closure returns Result<ControlFlow<bool>>
which is handled like this:
If its an Err(_)
- bubble up the error.
If it’s [ControlFlow::Break(bool)
] then the bool
is either to cancel the cooking
or just break the loop and return.
In case of [ControlFlow::Continue(_)
] run until completion.
See the pdg_cook
example in the /examples
folder.
sourcepub fn get_context_id(&self) -> Result<i32>
pub fn get_context_id(&self) -> Result<i32>
Get the graph(context) id of this node in PDG.
sourcepub fn cancel_cook(&self) -> Result<()>
pub fn cancel_cook(&self) -> Result<()>
Cancel cooking.
sourcepub fn dirty_node(&self, clean_results: bool) -> Result<()>
pub fn dirty_node(&self, clean_results: bool) -> Result<()>
Dirty the node, forcing the work items to regenerate.
sourcepub fn get_current_state(&self, context_id: Option<i32>) -> Result<PdgState>
pub fn get_current_state(&self, context_id: Option<i32>) -> Result<PdgState>
Which this node current PdgState
sourcepub fn get_workitem(
&self,
workitem_id: i32,
context_id: i32
) -> Result<PDGWorkItem<'_>>
pub fn get_workitem(
&self,
workitem_id: i32,
context_id: i32
) -> Result<PDGWorkItem<'_>>
Get the work item by id and graph(context) id.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TopNode
impl Send for TopNode
impl Sync for TopNode
impl Unpin for TopNode
impl !UnwindSafe for TopNode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more