Struct apint::BitWidth [−][src]
pub struct BitWidth(_);
The BitWidth
represents the length of an ApInt
.
Its invariant restricts it to always be a positive, non-zero value.
Code that built's on top of BitWidth
may and should use this invariant.
Methods
impl BitWidth
[src]
impl BitWidth
Constructors ===========================================================================
pub fn w1() -> Self
[src]
pub fn w1() -> Self
Creates a BitWidth
that represents a bit-width of 1
bit.
pub fn w8() -> Self
[src]
pub fn w8() -> Self
Creates a BitWidth
that represents a bit-width of 8
bits.
pub fn w16() -> Self
[src]
pub fn w16() -> Self
Creates a BitWidth
that represents a bit-width of 16
bits.
pub fn w32() -> Self
[src]
pub fn w32() -> Self
Creates a BitWidth
that represents a bit-width of 32
bits.
pub fn w64() -> Self
[src]
pub fn w64() -> Self
Creates a BitWidth
that represents a bit-width of 64
bits.
pub fn w128() -> Self
[src]
pub fn w128() -> Self
Creates a BitWidth
that represents a bit-width of 128
bits.
pub fn new(width: usize) -> Result<Self>
[src]
pub fn new(width: usize) -> Result<Self>
impl BitWidth
[src]
impl BitWidth
API ===========================================================================
Trait Implementations
impl Debug for BitWidth
[src]
impl Debug for BitWidth
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for BitWidth
[src]
impl Copy for BitWidth
impl Clone for BitWidth
[src]
impl Clone for BitWidth
fn clone(&self) -> BitWidth
[src]
fn clone(&self) -> BitWidth
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for BitWidth
[src]
impl PartialEq for BitWidth
fn eq(&self, other: &BitWidth) -> bool
[src]
fn eq(&self, other: &BitWidth) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BitWidth) -> bool
[src]
fn ne(&self, other: &BitWidth) -> bool
This method tests for !=
.
impl Eq for BitWidth
[src]
impl Eq for BitWidth
impl PartialOrd for BitWidth
[src]
impl PartialOrd for BitWidth
fn partial_cmp(&self, other: &BitWidth) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BitWidth) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &BitWidth) -> bool
[src]
fn lt(&self, other: &BitWidth) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &BitWidth) -> bool
[src]
fn le(&self, other: &BitWidth) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &BitWidth) -> bool
[src]
fn gt(&self, other: &BitWidth) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &BitWidth) -> bool
[src]
fn ge(&self, other: &BitWidth) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for BitWidth
[src]
impl Ord for BitWidth
fn cmp(&self, other: &BitWidth) -> Ordering
[src]
fn cmp(&self, other: &BitWidth) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for BitWidth
[src]
impl Hash for BitWidth
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl From<usize> for BitWidth
[src]
impl From<usize> for BitWidth
impl Serialize for BitWidth
[src]
impl Serialize for BitWidth
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for BitWidth
[src]
impl<'de> Deserialize<'de> for BitWidth
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more