pub struct Const {
pub name: String,
pub value: Value,
pub arch: Vec<Arch>,
}
Expand description
A named constant tied to one or more architectures
Fields§
§name: String
The name
value: Value
A value, which should be resolved
arch: Vec<Arch>
The architectures where this value is valid
Implementations§
Source§impl Const
impl Const
pub fn new<S: Into<String>>(name: S, value: Value, arch: Vec<Arch>) -> Self
Sourcepub fn new_allarch(name: String, value: Value) -> Self
pub fn new_allarch(name: String, value: Value) -> Self
Create a new const for all defined architectures.
pub fn as_uint(&self) -> Result<u64, Error>
Sourcepub fn is_for_arch(&self, arch: &Arch) -> bool
pub fn is_for_arch(&self, arch: &Arch) -> bool
Check if constant is valid for a given value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Const
impl<'de> Deserialize<'de> for Const
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 Const
impl StructuralPartialEq for Const
Auto Trait Implementations§
impl Freeze for Const
impl RefUnwindSafe for Const
impl Send for Const
impl Sync for Const
impl Unpin for Const
impl UnwindSafe for Const
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