pub struct Value {
pub kind: ValueKind,
pub ty: Type,
}Fields§
§kind: ValueKind§ty: TypeImplementations§
Source§impl Value
impl Value
pub fn new(id: Id, ty: Type) -> Self
pub fn constant(value: ConstantValue, ty: impl Into<Type>) -> Self
pub fn elem_type(&self) -> ElemType
pub fn storage_type(&self) -> StorageType
pub fn can_mutate(&self) -> bool
pub fn address_space(&self) -> AddressSpace
pub fn value_type(&self) -> Type
Source§impl Value
impl Value
Sourcepub fn is_immutable(&self) -> bool
pub fn is_immutable(&self) -> bool
Whether a value is always immutable. Used for optimizations to determine whether it’s safe to inline/merge
Sourcepub fn is_array_like(&self) -> bool
pub fn is_array_like(&self) -> bool
Is this an array type that yields items when indexed, or a scalar/vector that yields elems/slices when indexed?
pub fn is_value(&self) -> bool
Sourcepub fn is_memory(&self) -> bool
pub fn is_memory(&self) -> bool
Is this an value type that is contained in concrete memory, or a local array/scalar/vector?
pub fn has_buffer_length(&self) -> bool
Sourcepub fn is_constant(&self, value: i64) -> bool
pub fn is_constant(&self, value: i64) -> bool
Determines if the value is a constant with the specified value (converted if necessary)
Trait Implementations§
impl Copy for Value
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Value
Source§impl FromArgList for Value
impl FromArgList for Value
Source§fn from_arg_list(args: &mut VecDeque<Value>) -> Self
fn from_arg_list(args: &mut VecDeque<Value>) -> Self
Creates this type from a list of values. This works like a parse stream, where consumed
values are popped from the front.
Source§fn as_arg_list(&self) -> impl IntoIterator<Item = Value>
fn as_arg_list(&self) -> impl IntoIterator<Item = Value>
Turns this type into a list of
Values.fn as_arg_list_mut(&mut self) -> impl IntoIterator<Item = &mut Value>
Source§impl OperationArgs for Value
impl OperationArgs for Value
Source§fn sanitize_args_ptr(&mut self, scope: &Scope)
fn sanitize_args_ptr(&mut self, scope: &Scope)
Sanitize args for the
ptr constraint, loading inputs from pointers for ops that take values.
This is needed because Rust “helpfully” auto-derefs references, skipping the explicit deref
code that inserts a Memory::Load.Source§fn from_args(args: &[Value]) -> Option<Self>
fn from_args(args: &[Value]) -> Option<Self>
Construct this type from a list of arguments. If not all arguments are
Value, returns
NoneSource§fn as_args(&self) -> Option<Vec<Value>>
fn as_args(&self) -> Option<Vec<Value>>
Turns this type into a flat list of arguments. If not all arguments are
Value,
returns NoneSource§fn as_args_mut(&mut self) -> Option<Vec<&mut Value>>
fn as_args_mut(&mut self) -> Option<Vec<&mut Value>>
Turns this type into a flat list of arguments. If not all arguments are
Value,
returns Nonefn read_pointers(&self) -> Vec<Value>
fn write_pointers(&self) -> Vec<Value>
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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