pub enum Value<T> {
Variable(Variable),
Literal(T),
}
Expand description
Value which may either be a variable name or literal.
Variants§
Variable(Variable)
This value will be populated on the device when variables are set.
Literal(T)
Constant literal that will be set when the certificate is generated.
Implementations§
source§impl<T> Value<T>
impl<T> Value<T>
sourcepub fn variable(name: &str) -> Self
pub fn variable(name: &str) -> Self
Create a variable with the given name. No conversion applied.
sourcepub fn convert(var: &str, conversion: Conversion) -> Self
pub fn convert(var: &str, conversion: Conversion) -> Self
Create a variable with the given name and conversion.
sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Return true if the value is a literal
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Value<T>where
T: Deserialize<'de>,
SubstValue: ConvertValue<T>,
impl<'de, T> Deserialize<'de> for Value<T>where T: Deserialize<'de>, SubstValue: ConvertValue<T>,
source§fn deserialize<D>(deserializer: D) -> Result<Value<T>, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Value<T>, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq> PartialEq<Value<T>> for Value<T>
impl<T: PartialEq> PartialEq<Value<T>> for Value<T>
source§impl<T> Serialize for Value<T>where
SubstValue: ConvertValue<T>,
impl<T> Serialize for Value<T>where SubstValue: ConvertValue<T>,
source§impl<T> Subst for Value<T>where
Value<T>: Clone,
SubstValue: ConvertValue<T>,
impl<T> Subst for Value<T>where Value<T>: Clone, SubstValue: ConvertValue<T>,
impl<T: Eq> Eq for Value<T>
impl<T> StructuralEq for Value<T>
impl<T> StructuralPartialEq for Value<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Value<T>where T: RefUnwindSafe,
impl<T> Send for Value<T>where T: Send,
impl<T> Sync for Value<T>where T: Sync,
impl<T> Unpin for Value<T>where T: Unpin,
impl<T> UnwindSafe for Value<T>where T: UnwindSafe,
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more