pub enum ElemType {
Float(FloatKind),
Int(IntKind),
UInt(UIntKind),
Bool,
}Expand description
Conceptual element type, not necessarily the physical type used in the code
Variants§
Implementations§
Source§impl ElemType
impl ElemType
Sourcepub fn from_quant_param(quant_param: QuantParam) -> ElemType
pub fn from_quant_param(quant_param: QuantParam) -> ElemType
Creates an elem type that correspond to the given QuantParam.
Sourcepub fn from_quant_value(quant_value: QuantValue) -> ElemType
pub fn from_quant_value(quant_value: QuantValue) -> ElemType
Creates an elem type that correspond to the given QuantValue.
Sourcepub fn constant(&self, val: ConstantValue) -> Variable
pub fn constant(&self, val: ConstantValue) -> Variable
Create a constant from a constant value.
The output will have the same type as the element.
pub const fn min_vector_size(&self) -> u8
pub fn is_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn as_float(&self) -> Option<FloatKind>
pub fn max_variable(&self) -> Variable
pub fn min_variable(&self) -> Variable
pub fn epsilon(&self) -> f64
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ElemType
impl<'de> Deserialize<'de> for ElemType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ElemType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ElemType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ElemType> for StorageType
impl From<ElemType> for StorageType
Source§fn from(value: ElemType) -> StorageType
fn from(value: ElemType) -> StorageType
Converts to this type from the input type.
Source§impl Ord for ElemType
impl Ord for ElemType
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 ElemType
impl PartialOrd for ElemType
Source§impl Serialize for ElemType
impl Serialize for ElemType
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 ElemType
impl Eq for ElemType
impl StructuralPartialEq for ElemType
Auto Trait Implementations§
impl Freeze for ElemType
impl RefUnwindSafe for ElemType
impl Send for ElemType
impl Sync for ElemType
impl Unpin for ElemType
impl UnsafeUnpin for ElemType
impl UnwindSafe for ElemType
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
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
Source§impl<T> CompilationArg for T
impl<T> CompilationArg for T
Source§fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
Compilation args should be the same even with different element types. However, it isn’t
possible to enforce it with the type system. So, we make the compilation args serializable
and dynamically cast them. Read more
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.