pub struct WGSLStructField {
pub name: String,
pub ty: WGSLType,
pub builtin: Option<String>,
pub location: Option<u32>,
pub interpolate: Option<String>,
}Expand description
A field inside a WGSL struct.
Fields§
§name: StringField name.
ty: WGSLTypeField type.
builtin: Option<String>Optional built-in attribute (e.g. position, vertex_index).
location: Option<u32>Optional @location(N) attribute.
interpolate: Option<String>Optional interpolation attribute (e.g. flat).
Implementations§
Source§impl WGSLStructField
impl WGSLStructField
Sourcepub fn new(name: impl Into<String>, ty: WGSLType) -> Self
pub fn new(name: impl Into<String>, ty: WGSLType) -> Self
Create a plain field with no attributes.
Sourcepub fn builtin(
name: impl Into<String>,
ty: WGSLType,
builtin: impl Into<String>,
) -> Self
pub fn builtin( name: impl Into<String>, ty: WGSLType, builtin: impl Into<String>, ) -> Self
Create a field with a @builtin(…) attribute.
Trait Implementations§
Source§impl Clone for WGSLStructField
impl Clone for WGSLStructField
Source§fn clone(&self) -> WGSLStructField
fn clone(&self) -> WGSLStructField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WGSLStructField
impl RefUnwindSafe for WGSLStructField
impl Send for WGSLStructField
impl Sync for WGSLStructField
impl Unpin for WGSLStructField
impl UnsafeUnpin for WGSLStructField
impl UnwindSafe for WGSLStructField
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