pub enum VariableValue {
BigUint(BigUint),
String(String),
}
Variants§
Implementations§
Source§impl VariableValue
impl VariableValue
Source§impl VariableValue
impl VariableValue
Sourcepub fn handle_bits<E>(
self,
handler: impl Fn(String) -> Result<TranslationResult, E>,
) -> Result<TranslationResult, E>
pub fn handle_bits<E>( self, handler: impl Fn(String) -> Result<TranslationResult, E>, ) -> Result<TranslationResult, E>
Utility function for handling the happy case of the variable value being only 0 and 1, with default handling of other values.
The value passed to the handler is guaranteed to only contain 0 and 1, but it is not padded to the length of the vector, i.e. leading zeros can be missing. Use extend_string on the result to add the padding.
Trait Implementations§
Source§impl Clone for VariableValue
impl Clone for VariableValue
Source§fn clone(&self) -> VariableValue
fn clone(&self) -> VariableValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VariableValue
impl Debug for VariableValue
Source§impl<'de> Deserialize<'de> for VariableValue
impl<'de> Deserialize<'de> for VariableValue
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
Source§impl Display for VariableValue
impl Display for VariableValue
Source§impl PartialEq for VariableValue
impl PartialEq for VariableValue
Source§impl Serialize for VariableValue
impl Serialize for VariableValue
impl StructuralPartialEq for VariableValue
Auto Trait Implementations§
impl Freeze for VariableValue
impl RefUnwindSafe for VariableValue
impl Send for VariableValue
impl Sync for VariableValue
impl Unpin for VariableValue
impl UnwindSafe for VariableValue
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