pub struct Scalar {
pub kind: ScalarKind,
pub width: u8,
}
Available on
wgpu_core
or naga
only.Expand description
Characteristics of a scalar type.
Fields§
§kind: ScalarKind
How the value’s bits are to be interpreted.
width: u8
This size of the value in bytes.
Implementations§
source§impl Scalar
impl Scalar
sourcepub const fn automatic_conversion_combine(self, other: Scalar) -> Option<Scalar>
Available on wgpu_core
only.
pub const fn automatic_conversion_combine(self, other: Scalar) -> Option<Scalar>
wgpu_core
only.Find the common type of self
and other
under WGSL’s
automatic conversions.
If there are any scalars to which WGSL’s automatic conversions
will convert both self
and other
, return the best such
scalar. Otherwise, return None
.
sourcepub fn automatically_converts_to(self, goal: Scalar) -> bool
Available on wgpu_core
only.
pub fn automatically_converts_to(self, goal: Scalar) -> bool
wgpu_core
only.Return true
if automatic conversions will covert self
to goal
.
source§impl Scalar
impl Scalar
pub const I32: Scalar = _
Available on
wgpu_core
only.pub const U32: Scalar = _
Available on
wgpu_core
only.pub const F32: Scalar = _
Available on
wgpu_core
only.pub const F64: Scalar = _
Available on
wgpu_core
only.pub const I64: Scalar = _
Available on
wgpu_core
only.pub const U64: Scalar = _
Available on
wgpu_core
only.pub const BOOL: Scalar = _
Available on
wgpu_core
only.pub const ABSTRACT_INT: Scalar = _
Available on
wgpu_core
only.pub const ABSTRACT_FLOAT: Scalar = _
Available on
wgpu_core
only.pub const fn is_abstract(self) -> bool
Available on
wgpu_core
only.sourcepub const fn float(width: u8) -> Scalar
Available on wgpu_core
only.
pub const fn float(width: u8) -> Scalar
wgpu_core
only.Construct a float Scalar
with the given width.
This is especially common when dealing with
TypeInner::Matrix
, where the scalar kind is implicit.
pub const fn to_inner_scalar(self) -> TypeInner
Available on
wgpu_core
only.pub const fn to_inner_vector(self, size: VectorSize) -> TypeInner
Available on
wgpu_core
only.pub const fn to_inner_atomic(self) -> TypeInner
Available on
wgpu_core
only.Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Scalar
impl<'arbitrary> Arbitrary<'arbitrary> for Scalar
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Scalar, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Scalar, Error>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§impl<'de> Deserialize<'de> for Scalar
impl<'de> Deserialize<'de> for Scalar
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Scalar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Scalar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Scalar
impl Ord for Scalar
source§impl PartialEq for Scalar
impl PartialEq for Scalar
source§impl PartialOrd for Scalar
impl PartialOrd for Scalar
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Scalar
impl Serialize for Scalar
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Scalar
impl Eq for Scalar
impl StructuralEq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnwindSafe for Scalar
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.