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>
impl<'de, T> Deserialize<'de> for Value<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> Serialize for Value<T>where
SubstValue: ConvertValue<T>,
impl<T> Serialize for Value<T>where
SubstValue: ConvertValue<T>,
impl<T: Eq> Eq for Value<T>
impl<T> StructuralPartialEq for Value<T>
Auto Trait Implementations§
impl<T> Freeze for Value<T>where
T: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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