pub enum ValueInner {
Datum(DatumValue),
Variable(VariableValue),
Text(TextValue),
Markup(Markup),
Template(TemplateValue),
Empty,
}Expand description
Possible content for a Value.
Variants§
Datum(DatumValue)
A Datum value.
Tuple Fields
0: DatumValueThe datum.
Variable(VariableValue)
A variable name.
Tuple Fields
0: VariableValueThe variable.
Text(TextValue)
Plain text.
Markup(Markup)
Rich text.
Template(TemplateValue)
A template with substitutions.
Tuple Fields
0: TemplateValueThe template.
Empty
An empty value.
Implementations§
Source§impl ValueInner
impl ValueInner
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns true if this is a ValueInner::Empty.
Sourcepub fn with_format(self, format: impl Into<ValueFormat>) -> Self
pub fn with_format(self, format: impl Into<ValueFormat>) -> Self
Returns this value with its display format set to format, if it is a
DatumValue.
Sourcepub fn datum(&self) -> Option<&Datum<WithEncoding<ByteString>>>
pub fn datum(&self) -> Option<&Datum<WithEncoding<ByteString>>>
Returns the Datum inside this value, if it is a DatumValue.
Sourcepub fn label(&self) -> Option<&str>
pub fn label(&self) -> Option<&str>
Returns the value label or variable label inside this value, if it has one.
Sourcepub fn as_datum_value(&self) -> Option<&DatumValue>
pub fn as_datum_value(&self) -> Option<&DatumValue>
Returns the DatumValue inside this value, if it is ValueInner::Datum.
Sourcepub fn as_datum_value_mut(&mut self) -> Option<&mut DatumValue>
pub fn as_datum_value_mut(&mut self) -> Option<&mut DatumValue>
Returns the DatumValue inside this value, mutably, if it is ValueInner::Datum.
Sourcepub fn as_variable_value(&self) -> Option<&VariableValue>
pub fn as_variable_value(&self) -> Option<&VariableValue>
Returns the VariableValue inside this value, if it is ValueInner::Variable.
Sourcepub fn as_variable_value_mut(&mut self) -> Option<&mut VariableValue>
pub fn as_variable_value_mut(&mut self) -> Option<&mut VariableValue>
Returns the VariableValue inside this value, mutably, if it is ValueInner::Variable.
Sourcepub fn display(&self, options: impl Into<ValueOptions>) -> DisplayValue<'_>
pub fn display(&self, options: impl Into<ValueOptions>) -> DisplayValue<'_>
Returns an object that will format this value. Settings on options
control whether variable and value labels are included.
Sourcepub fn new_user_text(s: impl Into<String>) -> Self
pub fn new_user_text(s: impl Into<String>) -> Self
Constructs a new text ValueInner from s, which should have been
provided by the user.
Trait Implementations§
Source§impl Clone for ValueInner
impl Clone for ValueInner
Source§fn clone(&self) -> ValueInner
fn clone(&self) -> ValueInner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValueInner
impl Debug for ValueInner
Source§impl Default for ValueInner
impl Default for ValueInner
Source§fn default() -> ValueInner
fn default() -> ValueInner
Source§impl PartialEq for ValueInner
impl PartialEq for ValueInner
Source§impl Serialize for ValueInner
impl Serialize for ValueInner
impl StructuralPartialEq for ValueInner
Auto Trait Implementations§
impl Freeze for ValueInner
impl RefUnwindSafe for ValueInner
impl Send for ValueInner
impl Sync for ValueInner
impl Unpin for ValueInner
impl UnsafeUnpin for ValueInner
impl UnwindSafe for ValueInner
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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