Skip to main content

Node

Struct Node 

Source
pub struct Node { /* private fields */ }

Implementations§

Source§

impl Node

Source

pub fn root() -> Node

Creates the single root node that owns a program’s other nodes.

Source

pub fn scope(name: String) -> Node

Creates a scope that groups child nodes.

Source

pub fn struct(name: &str, fields: Vec<NodeReference>) -> Node

Creates a named struct definition from its fields.

Source

pub fn member(name: &str, type: NodeReference) -> Node

Source

pub fn array(name: &str, type: NodeReference, size: usize) -> NodeReference

Source

pub fn function( name: &str, params: Vec<NodeReference>, return_type: NodeReference, statements: Vec<NodeReference>, ) -> Node

Source

pub fn conditional( condition: NodeReference, statements: Vec<NodeReference>, ) -> Node

Source

pub fn for_loop( initializer: NodeReference, condition: NodeReference, update: NodeReference, statements: Vec<NodeReference>, ) -> Node

Source

pub fn expression(expression: Expressions) -> Node

Source

pub fn glsl( code: String, inputs: Vec<NodeReference>, outputs: Vec<NodeReference>, ) -> Node

Source

pub fn hlsl( code: String, inputs: Vec<NodeReference>, outputs: Vec<NodeReference>, ) -> Node

Source

pub fn msl( code: String, inputs: Vec<NodeReference>, outputs: Vec<NodeReference>, ) -> Node

Source

pub fn raw( glsl: Option<String>, hlsl: Option<String>, msl: Option<String>, inputs: Vec<NodeReference>, outputs: Vec<NodeReference>, ) -> Node

Builds linked raw code with explicit backend sources and interface nodes.

Source

pub fn macro(name: &str, body: NodeReference) -> Node

Source

pub fn binding( name: &str, type: BindingTypes, slot: u32, read: bool, write: bool, ) -> Node

Source

pub fn binding_array( name: &str, type: BindingTypes, slot: u32, read: bool, write: bool, count: usize, ) -> Node

Source

pub fn push_constant(members: Vec<NodeReference>) -> Node

Source

pub fn intrinsic( name: &str, elements: Vec<NodeReference>, return: NodeReference, ) -> Node

Source

pub fn specialization(name: &str, type: NodeReference) -> Node

Source

pub fn constant(name: &str, type: NodeReference, value: NodeReference) -> Node

Source

pub fn input(name: &str, format: NodeReference, location: u8) -> Node

Source

pub fn output(name: &str, format: NodeReference, location: u8) -> Node

Source

pub fn output_array( name: &str, format: NodeReference, location: u8, count: u32, ) -> Node

Source

pub fn task_payload(name: &str, format: NodeReference, count: u32) -> Node

Source

pub fn workgroup(name: &str, format: NodeReference) -> Node

Source

pub fn new(node: Nodes) -> Node

Source

pub fn add_child(&mut self, child: NodeReference) -> NodeReference

Source

pub fn add_children( &mut self, children: Vec<NodeReference>, ) -> Vec<NodeReference>

Source

pub fn node(&self) -> &Nodes

Source

pub fn get_name(&self) -> Option<&str>

Source

pub fn get_children(&self) -> Option<Vec<NodeReference>>

Source

pub fn get_child(&self, child_name: &str) -> Option<NodeReference>

Source

pub fn node_mut(&mut self) -> &mut Nodes

Source

pub fn null() -> Node

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

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

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

impl From<Node> for NodeReference

Source§

fn from(node: Node) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Node

§

impl !Send for Node

§

impl !Sync for Node

§

impl !UnwindSafe for Node

§

impl Freeze for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.