pub struct StructInstance {
pub ty: StructType,
pub members: Vec<Instance>,
}Expand description
Instance of a struct type.
Reference: https://www.w3.org/TR/WGSL/#struct-types
Fields§
§ty: StructType§members: Vec<Instance>Implementations§
Source§impl StructInstance
impl StructInstance
Sourcepub fn zero_value(s: &StructType) -> Result<Self, Error>
pub fn zero_value(s: &StructType) -> Result<Self, Error>
Zero-value initialize a struct instance.
Source§impl StructInstance
impl StructInstance
Trait Implementations§
Source§impl Clone for StructInstance
impl Clone for StructInstance
Source§fn clone(&self) -> StructInstance
fn clone(&self) -> StructInstance
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 moreSource§impl Convert for StructInstance
impl Convert for StructInstance
Source§fn convert_to(&self, ty: &Type) -> Option<Self>
fn convert_to(&self, ty: &Type) -> Option<Self>
Convert an instance to another type, if a feasible conversion exists. Read more
Source§fn convert_inner_to(&self, ty: &Type) -> Option<Self>
fn convert_inner_to(&self, ty: &Type) -> Option<Self>
Convert an instance by changing its inner type to another. Read more
Source§fn concretize(&self) -> Option<Self>
fn concretize(&self) -> Option<Self>
Convert an abstract instance to a concrete type. Read more
Source§impl Debug for StructInstance
impl Debug for StructInstance
Source§impl Display for StructInstance
impl Display for StructInstance
Source§impl From<StructInstance> for Instance
impl From<StructInstance> for Instance
Source§fn from(value: StructInstance) -> Self
fn from(value: StructInstance) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StructInstance
impl PartialEq for StructInstance
Source§impl Ty for StructInstance
impl Ty for StructInstance
impl StructuralPartialEq for StructInstance
Auto Trait Implementations§
impl Freeze for StructInstance
impl !RefUnwindSafe for StructInstance
impl !Send for StructInstance
impl !Sync for StructInstance
impl Unpin for StructInstance
impl !UnwindSafe for StructInstance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more