Skip to main content

Nodes

Enum Nodes 

Source
pub enum Nodes<'a> {
Show 24 variants Null, Scope { name: &'a str, children: Vec<Node<'a>>, }, Struct { name: &'a str, fields: Vec<Node<'a>>, }, Member { name: &'a str, type: String, }, Function { name: &'a str, params: Vec<Node<'a>>, return_type: &'a str, statements: Vec<Node<'a>>, }, Conditional { condition: Box<Node<'a>>, statements: Vec<Node<'a>>, }, ForLoop { initializer: Box<Node<'a>>, condition: Box<Node<'a>>, update: Box<Node<'a>>, statements: Vec<Node<'a>>, }, Binding { name: &'a str, type: Box<Node<'a>>, slot: u32, read: bool, write: bool, count: Option<NonZeroUsize>, }, Descriptor { name: &'a str, resource_type: &'a str, format: Option<&'a str>, slot: u32, read: bool, write: bool, count: Option<NonZeroU32>, }, Specialization { name: &'a str, type: &'a str, }, PushConstant { members: Vec<Node<'a>>, }, Type { name: &'a str, members: Vec<Node<'a>>, }, Image { format: &'a str, }, CombinedImageSampler { format: &'a str, }, Expression(Expressions<'a>), RawCode { glsl: Option<Cow<'a, str>>, hlsl: Option<Cow<'a, str>>, msl: Option<Cow<'a, str>>, input: &'a [&'a str], output: &'a [&'a str], }, Intrinsic { name: &'a str, elements: Vec<Node<'a>>, return: &'a str, }, Input { name: &'a str, format: &'a str, location: u8, }, Output { name: &'a str, format: &'a str, location: u8, count: Option<NonZeroUsize>, }, TaskPayload { name: &'a str, format: &'a str, count: NonZeroUsize, }, Workgroup { name: &'a str, format: &'a str, }, Literal { name: &'a str, body: Box<Node<'a>>, }, Parameter { name: &'a str, type: &'a str, }, Const { name: &'a str, type: TypeName<'a>, value: Box<Node<'a>>, },
}

Variants§

§

Null

A placeholder for syntax that does not yet have a specialized node.

§

Scope

A named group of BESL declarations, similar to a Rust module.

Fields

§name: &'a str

The name used for imports and namespaces.

§children: Vec<Node<'a>>
§

Struct

A struct declaration and its fields.

Fields

§name: &'a str
§fields: Vec<Node<'a>>
§

Member

A field declared in a struct.

Fields

§name: &'a str
§type: String
§

Function

A function declaration and body.

Fields

§name: &'a str
§params: Vec<Node<'a>>
§return_type: &'a str
§statements: Vec<Node<'a>>
§

Conditional

Fields

§condition: Box<Node<'a>>
§statements: Vec<Node<'a>>
§

ForLoop

Fields

§initializer: Box<Node<'a>>
§condition: Box<Node<'a>>
§update: Box<Node<'a>>
§statements: Vec<Node<'a>>
§

Binding

A shader resource binding declaration.

Fields

§name: &'a str
§type: Box<Node<'a>>
§slot: u32
§read: bool
§write: bool
§

Descriptor

A flat resource descriptor declared directly in BESL source.

Fields

§name: &'a str
§resource_type: &'a str
§format: Option<&'a str>
§slot: u32
§read: bool
§write: bool
§

Specialization

A constant selected when the application creates a pipeline.

Fields

§name: &'a str
§type: &'a str
§

PushConstant

A small constant buffer updated during rendering.

Fields

§members: Vec<Node<'a>>
§

Type

An abstract type declaration, such as the declaration for f32.

Fields

§name: &'a str
§members: Vec<Node<'a>>
§

Image

Fields

§format: &'a str
§

CombinedImageSampler

Fields

§format: &'a str
§

Expression(Expressions<'a>)

§

RawCode

Fields

§glsl: Option<Cow<'a, str>>
§hlsl: Option<Cow<'a, str>>
§msl: Option<Cow<'a, str>>
§input: &'a [&'a str]
§output: &'a [&'a str]
§

Intrinsic

Fields

§name: &'a str
§elements: Vec<Node<'a>>
§return: &'a str
§

Input

Fields

§name: &'a str
§format: &'a str
§location: u8
§

Output

Fields

§name: &'a str
§format: &'a str
§location: u8
§

TaskPayload

An array carried from a task shader invocation group to the mesh work it emits.

Fields

§name: &'a str
§format: &'a str
§

Workgroup

Storage shared by all invocations in one task or compute workgroup.

Fields

§name: &'a str
§format: &'a str
§

Literal

Fields

§name: &'a str
§body: Box<Node<'a>>
§

Parameter

Fields

§name: &'a str
§type: &'a str
§

Const

A named module-level value known at compile time.

Fields

§name: &'a str
§type: TypeName<'a>
§value: Box<Node<'a>>

Trait Implementations§

Source§

impl<'a> Clone for Nodes<'a>

Source§

fn clone(&self) -> Nodes<'a>

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<'a> Debug for Nodes<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Nodes<'a>

§

impl<'a> RefUnwindSafe for Nodes<'a>

§

impl<'a> Send for Nodes<'a>

§

impl<'a> Sync for Nodes<'a>

§

impl<'a> Unpin for Nodes<'a>

§

impl<'a> UnsafeUnpin for Nodes<'a>

§

impl<'a> UnwindSafe for Nodes<'a>

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.