pub enum Literal {
F64(f64),
F32(f32),
U32(u32),
I32(i32),
U64(u64),
I64(i64),
Bool(bool),
AbstractInt(i64),
AbstractFloat(f64),
}
Available on
wgpu_core
or naga
only.Variants§
F64(f64)
May not be NaN or infinity.
F32(f32)
May not be NaN or infinity.
U32(u32)
I32(i32)
U64(u64)
I64(i64)
Bool(bool)
AbstractInt(i64)
AbstractFloat(f64)
Implementations§
source§impl Literal
impl Literal
pub const fn new(value: u8, scalar: Scalar) -> Option<Literal>
Available on
wgpu_core
only.pub const fn zero(scalar: Scalar) -> Option<Literal>
Available on
wgpu_core
only.pub const fn one(scalar: Scalar) -> Option<Literal>
Available on
wgpu_core
only.pub const fn width(&self) -> u8
Available on
wgpu_core
only.pub const fn scalar(&self) -> Scalar
Available on
wgpu_core
only.pub const fn scalar_kind(&self) -> ScalarKind
Available on
wgpu_core
only.pub const fn ty_inner(&self) -> TypeInner
Available on
wgpu_core
only.Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Literal
impl<'arbitrary> Arbitrary<'arbitrary> for Literal
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Literal, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Literal, Error>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§impl<'de> Deserialize<'de> for Literal
impl<'de> Deserialize<'de> for Literal
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Literal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Literal, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Literal> for HashableLiteral
impl From<Literal> for HashableLiteral
source§fn from(l: Literal) -> HashableLiteral
fn from(l: Literal) -> HashableLiteral
Converts to this type from the input type.
source§impl PartialEq for Literal
impl PartialEq for Literal
source§impl PartialOrd for Literal
impl PartialOrd for Literal
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 Literal
impl Serialize for Literal
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 Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
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