Struct melior::ir::type::IntegerType

source ·
pub struct IntegerType<'c> { /* private fields */ }
Expand description

A integer type.

Implementations§

source§

impl<'c> IntegerType<'c>

source

pub fn new(context: &'c Context, bits: u32) -> Self

Creates an integer type.

source

pub fn signed(context: &'c Context, bits: u32) -> Self

Creates a signed integer type.

source

pub fn unsigned(context: &'c Context, bits: u32) -> Self

Creates an unsigned integer type.

source

pub fn width(&self) -> u32

Returns a bit width.

source

pub fn is_signed(&self) -> bool

Checks if an integer type is signed.

source

pub fn is_signless(&self) -> bool

Checks if an integer type is signless.

source

pub fn is_unsigned(&self) -> bool

Checks if an integer type is unsigned.

Trait Implementations§

source§

impl<'c> Clone for IntegerType<'c>

source§

fn clone(&self) -> IntegerType<'c>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'c> Debug for IntegerType<'c>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'c> Display for IntegerType<'c>

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'c> From<IntegerType<'c>> for Type<'c>

source§

fn from(value: IntegerType<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Type<'c>> for IntegerType<'c>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(type: Type<'c>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'c> TypeLike<'c> for IntegerType<'c>

source§

fn to_raw(&self) -> MlirType

Converts a type into a raw object.
source§

fn context(&self) -> ContextRef<'c>

Returns a context.
source§

fn id(&self) -> TypeId<'c>

Returns an ID.
source§

fn dialect(&self) -> Dialect<'c>

Returns a dialect.
source§

fn dump(&self)

Dumps a type.
source§

fn is_any_quantized_type(&self) -> bool

Returns true if a type is any quantized type.
source§

fn is_bf16(&self) -> bool

Returns true if a type is bf16.
source§

fn is_calibrated_quantized_type(&self) -> bool

Returns true if a type is calibrated quantized type.
source§

fn is_complex(&self) -> bool

Returns true if a type is complex.
source§

fn is_f16(&self) -> bool

Returns true if a type is f16.
source§

fn is_f32(&self) -> bool

Returns true if a type is f32.
source§

fn is_f64(&self) -> bool

Returns true if a type is f64.
source§

fn is_float8e4m3fn(&self) -> bool

Returns true if a type is float8e4m3fn.
source§

fn is_float8e5m2(&self) -> bool

Returns true if a type is float8e5m2.
source§

fn is_function(&self) -> bool

Returns true if a type is function.
source§

fn is_index(&self) -> bool

Returns true if a type is index.
source§

fn is_integer(&self) -> bool

Returns true if a type is integer.
source§

fn is_mem_ref(&self) -> bool

Returns true if a type is mem ref.
source§

fn is_none(&self) -> bool

Returns true if a type is none.
source§

fn is_opaque(&self) -> bool

Returns true if a type is opaque.
source§

fn is_pdl_attribute_type(&self) -> bool

Returns true if a type is pdl attribute type.
source§

fn is_pdl_operation_type(&self) -> bool

Returns true if a type is pdl operation type.
source§

fn is_pdl_range_type(&self) -> bool

Returns true if a type is pdl range type.
source§

fn is_pdl_type(&self) -> bool

Returns true if a type is pdl type.
source§

fn is_pdl_type_type(&self) -> bool

Returns true if a type is pdl type type.
source§

fn is_pdl_value_type(&self) -> bool

Returns true if a type is pdl value type.
source§

fn is_quantized_type(&self) -> bool

Returns true if a type is quantized type.
source§

fn is_ranked_tensor(&self) -> bool

Returns true if a type is ranked tensor.
source§

fn is_shaped(&self) -> bool

Returns true if a type is shaped.
source§

fn is_tensor(&self) -> bool

Returns true if a type is tensor.
source§

fn is_transform_any_op_type(&self) -> bool

Returns true if a type is transform any op type.
source§

fn is_transform_operation_type(&self) -> bool

Returns true if a type is transform operation type.
source§

fn is_tuple(&self) -> bool

Returns true if a type is tuple.
source§

fn is_uniform_quantized_per_axis_type(&self) -> bool

Returns true if a type is uniform quantized per axis type.
source§

fn is_uniform_quantized_type(&self) -> bool

Returns true if a type is uniform quantized type.
source§

fn is_unranked_mem_ref(&self) -> bool

Returns true if a type is unranked mem ref.
source§

fn is_unranked_tensor(&self) -> bool

Returns true if a type is unranked tensor.
source§

fn is_vector(&self) -> bool

Returns true if a type is vector.
source§

impl<'c> Copy for IntegerType<'c>

Auto Trait Implementations§

§

impl<'c> RefUnwindSafe for IntegerType<'c>

§

impl<'c> !Send for IntegerType<'c>

§

impl<'c> !Sync for IntegerType<'c>

§

impl<'c> Unpin for IntegerType<'c>

§

impl<'c> UnwindSafe for IntegerType<'c>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.