pub struct DatumValue {
pub datum: Datum<WithEncoding<ByteString>>,
pub format: ValueFormat,
pub show: Option<Show>,
pub variable: Option<String>,
pub value_label: Option<String>,
}Expand description
A datum and how to display it.
Fields§
§datum: Datum<WithEncoding<ByteString>>The datum.
format: ValueFormatThe display format.
show: Option<Show>Whether to show value or value_label or both.
If this is unset, then a higher-level default is used.
variable: Option<String>The name of the variable that value came from, if any.
value_label: Option<String>The value label associated with value, if any.
Implementations§
Source§impl DatumValue
impl DatumValue
Sourcepub fn new<B>(datum: &Datum<B>) -> Selfwhere
B: EncodedString,
pub fn new<B>(datum: &Datum<B>) -> Selfwhere
B: EncodedString,
Constructs a new DatumValue for datum.
Sourcepub fn new_number(number: Option<f64>) -> Self
pub fn new_number(number: Option<f64>) -> Self
Constructs a new DatumValue for number.
Sourcepub fn with_format(self, format: ValueFormat) -> Self
pub fn with_format(self, format: ValueFormat) -> Self
Returns this DatumValue with the given format.
Sourcepub fn display<'a>(
&self,
display: &DisplayValue<'a>,
f: &mut Formatter<'_>,
) -> Result
pub fn display<'a>( &self, display: &DisplayValue<'a>, f: &mut Formatter<'_>, ) -> Result
Writes this value to f using the settings in display.
Sourcepub fn decimal(&self) -> Decimal
pub fn decimal(&self) -> Decimal
Returns the decimal point used in the formatted value, if any.
Sourcepub fn serialize_bare<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn serialize_bare<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serializes this value to serializer in the “bare” manner described for
BareValue.
Trait Implementations§
Source§impl Clone for DatumValue
impl Clone for DatumValue
Source§fn clone(&self) -> DatumValue
fn clone(&self) -> DatumValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DatumValue
impl Debug for DatumValue
Source§impl PartialEq for DatumValue
impl PartialEq for DatumValue
Source§impl Serialize for DatumValue
impl Serialize for DatumValue
impl StructuralPartialEq for DatumValue
Auto Trait Implementations§
impl Freeze for DatumValue
impl RefUnwindSafe for DatumValue
impl Send for DatumValue
impl Sync for DatumValue
impl Unpin for DatumValue
impl UnsafeUnpin for DatumValue
impl UnwindSafe for DatumValue
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,
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