pub struct Binding { /* private fields */ }Expand description
Represents a binding in a shader module. Example:
@group(0) @binding(1) var<uniform> myBinding: MyType;Implementations§
Source§impl Binding
impl Binding
Sourcepub fn new(
docs: Option<String>,
attr_group: u16,
attr_binding: u16,
name: String,
ty: Type,
) -> Binding
pub fn new( docs: Option<String>, attr_group: u16, attr_binding: u16, name: String, ty: Type, ) -> Binding
Creates a new Binding instance (usually from parsed elements).
Sourcepub fn binding_type(&self) -> &Type
pub fn binding_type(&self) -> &Type
Get field type from instance of Binding.
Sourcepub fn rendered(&self, imports: &[Import]) -> RenderedBinding
pub fn rendered(&self, imports: &[Import]) -> RenderedBinding
Renders the binding into a serializable form for templates.
Trait Implementations§
impl Eq for Binding
Source§impl RegisterImports for Binding
impl RegisterImports for Binding
Source§fn register_imports(&mut self, imports: &[Import])
fn register_imports(&mut self, imports: &[Import])
Registers the imports used by the type.
Source§fn register_same_module_types(&mut self, type_names: &[String])
fn register_same_module_types(&mut self, type_names: &[String])
Registers the types from the same module as the type.
Auto Trait Implementations§
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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