pub enum ConstValue {
Null,
Boolean(bool),
Number(Number),
String(String),
}Expand description
A ConstValue is similar to a saphyr::Scalar, but for validating “number” types
we treat integers and floating point values as ‘fungible’ and represent them
using the Number enum.
Variants§
Implementations§
Source§impl ConstValue
impl ConstValue
pub fn null() -> ConstValue
pub fn boolean(value: bool) -> ConstValue
pub fn integer(value: i64) -> ConstValue
pub fn float(value: f64) -> ConstValue
pub fn string<V: Into<String>>(value: V) -> ConstValue
Trait Implementations§
Source§impl Debug for ConstValue
impl Debug for ConstValue
Source§impl Display for ConstValue
impl Display for ConstValue
Source§impl PartialEq for ConstValue
impl PartialEq for ConstValue
Source§impl<'a> TryFrom<&MarkedYaml<'a>> for ConstValue
impl<'a> TryFrom<&MarkedYaml<'a>> for ConstValue
Source§fn try_from(value: &MarkedYaml<'a>) -> Result<ConstValue>
fn try_from(value: &MarkedYaml<'a>) -> Result<ConstValue>
Performs the conversion.
Source§impl TryFrom<&Scalar<'_>> for ConstValue
impl TryFrom<&Scalar<'_>> for ConstValue
Source§impl<'a> TryFrom<&YamlData<'a, MarkedYaml<'a>>> for ConstValue
impl<'a> TryFrom<&YamlData<'a, MarkedYaml<'a>>> for ConstValue
impl StructuralPartialEq for ConstValue
Auto Trait Implementations§
impl Freeze for ConstValue
impl RefUnwindSafe for ConstValue
impl Send for ConstValue
impl Sync for ConstValue
impl Unpin for ConstValue
impl UnwindSafe for ConstValue
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.