Struct hapi_rs::pdg::TopNode

source ·
pub struct TopNode {
    pub node: HoudiniNode,
}
Expand description

A wrapper for HoudiniNode with methods for cooking PDG.

Fields§

§node: HoudiniNode

Implementations§

source§

impl TopNode

source

pub fn cook_async<F>(&self, all_outputs: bool, func: F) -> Result<()>

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.

source

pub fn cook_pdg_blocking(&self) -> Result<()>

source

pub fn get_context_id(&self) -> Result<i32>

Get the graph(context) id of this node in PDG.

source

pub fn cancel_cooking(&self) -> Result<()>

Cancel cooking.

source

pub fn pause_cooking(&self) -> Result<()>

Pause cooking process

source

pub fn dirty_node(&self, clean_results: bool) -> Result<()>

Dirty the node, forcing the work items to regenerate.

source

pub fn get_current_state(&self, context_id: Option<i32>) -> Result<PdgState>

Which this node current PdgState

source

pub fn get_workitem(&self, workitem_id: WorkItemId) -> Result<PDGWorkItem<'_>>

Get the work item by id and graph(context) id.

source

pub fn get_all_workitems(&self) -> Result<Vec<PDGWorkItem<'_>>>

source

pub fn create_workitem( &self, name: &str, index: i32, context_id: Option<i32> ) -> Result<PDGWorkItem<'_>>

source

pub fn commit_workitems(&self) -> Result<()>

Trait Implementations§

source§

impl Clone for TopNode

source§

fn clone(&self) -> TopNode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TopNode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<TopNode> for NodeHandle

source§

fn from(value: TopNode) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.