Enum dbase::FieldValue

source ·
pub enum FieldValue {
    Character(Option<String>),
    Numeric(Option<f64>),
    Logical(Option<bool>),
    Date(Option<Date>),
    Float(Option<f32>),
    Integer(i32),
    Currency(f64),
    DateTime(DateTime),
    Double(f64),
    Memo(String),
}
Expand description

Enum where each variant stores the record value

Variants§

§

Character(Option<String>)

dBase String type

A string full of ‘pad bytes’ is considered None

§

Numeric(Option<f64>)

dBase type to represent numbers, stored as String in the file

§

Logical(Option<bool>)

dBase type for boolean values, stored as a character in the file

§

Date(Option<Date>)

dBase type for dates, stored as a string in the file

§

Float(Option<f32>)

Another dBase type to represent numbers, stored as String in the file

§

Integer(i32)

§

Currency(f64)

§

DateTime(DateTime)

§

Double(f64)

§

Memo(String)

Memo is a dBase type that allows to store Strings that are longer than 255 bytes. These strings are stored in an external file called the Memo file

Implementations§

source§

impl FieldValue

source

pub fn field_type(&self) -> FieldType

Returns the corresponding field type of the contained value

Trait Implementations§

source§

impl Clone for FieldValue

source§

fn clone(&self) -> FieldValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FieldValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for FieldValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Date> for FieldValue

source§

fn from(v: Date) -> Self

Converts to this type from the input type.
source§

impl From<DateTime> for FieldValue

source§

fn from(v: DateTime) -> Self

Converts to this type from the input type.
source§

impl From<Option<Date>> for FieldValue

source§

fn from(v: Option<Date>) -> Self

Converts to this type from the input type.
source§

impl From<Option<String>> for FieldValue

source§

fn from(v: Option<String>) -> Self

Converts to this type from the input type.
source§

impl From<Option<bool>> for FieldValue

source§

fn from(v: Option<bool>) -> Self

Converts to this type from the input type.
source§

impl From<Option<f32>> for FieldValue

source§

fn from(v: Option<f32>) -> Self

Converts to this type from the input type.
source§

impl From<Option<f64>> for FieldValue

source§

fn from(v: Option<f64>) -> Self

Converts to this type from the input type.
source§

impl From<String> for FieldValue

source§

fn from(v: String) -> Self

Converts to this type from the input type.
source§

impl From<bool> for FieldValue

source§

fn from(v: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for FieldValue

source§

fn from(v: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for FieldValue

source§

fn from(v: f64) -> Self

Converts to this type from the input type.
source§

impl PartialEq for FieldValue

source§

fn eq(&self, other: &FieldValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<FieldValue> for Date

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for DateTime

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for Option<Date>

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for Option<String>

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for Option<bool>

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for Option<f32>

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for Option<f64>

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for String

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for bool

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for f32

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for f64

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<FieldValue> for i32

§

type Error = FieldConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: FieldValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for FieldValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.