Struct awint_macro_internals::Usb
source · pub struct Usb {
pub s: Vec<char>,
pub x: i128,
}
Expand description
Usize and/or String Bound. If s.is_empty()
, then there is no arbitrary
string in the bound and the base value is 0. x
is added on to the value.
Fields§
§s: Vec<char>
§x: i128
Implementations§
source§impl Usb
impl Usb
pub const fn zero() -> Self
pub fn new_s(s: &[char]) -> Self
pub const fn val(x: i128) -> Self
sourcepub fn simplify(&mut self) -> Result<(), String>
pub fn simplify(&mut self) -> Result<(), String>
Tries to parse the s
part of self
as an integer and adds it to x
.
Performs advanced simplifications such as interpreting
({+/-}{string/i128} {+/-} {+/-}{string/i128})
.
Returns true
if simplification happened
pub fn static_val(&self) -> Option<i128>
sourcepub fn is_guaranteed_zero(&self) -> bool
pub fn is_guaranteed_zero(&self) -> bool
Returns if we statically determine the bitwidth to be zero
Trait Implementations§
impl Eq for Usb
impl StructuralPartialEq for Usb
Auto Trait Implementations§
impl RefUnwindSafe for Usb
impl Send for Usb
impl Sync for Usb
impl Unpin for Usb
impl UnwindSafe for Usb
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