Struct dbase::Date

source ·
pub struct Date { /* private fields */ }
Expand description

dBase representation of date

Note

This is really really naive date, it just holds the day, moth, year value with just a very few checks.

Also, dBase files do not have concept of timezones.

Implementations§

source§

impl Date

source

pub const fn new(day: u32, month: u32, year: u32) -> Self

Creates a new dbase::Date

panic

panics if the year has more than 4 digits or if the day is greater than 31 or the month greater than 12

source

pub fn year(&self) -> u32

Returns the year

source

pub fn month(&self) -> u32

Returns the month

source

pub fn day(&self) -> u32

Returns the day

source

pub fn to_unix_days(&self) -> i32

Trait Implementations§

source§

impl Clone for Date

source§

fn clone(&self) -> Date

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 Date

source§

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

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

impl<'de> Deserialize<'de> for Date

source§

fn deserialize<D>( deserializer: D ) -> Result<Self, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Date> for Date

source§

fn from(d: Date) -> Self

Converts to this type from the input type.
source§

impl From<Date> for FieldValue

source§

fn from(v: Date) -> Self

Converts to this type from the input type.
source§

impl FromStr for Date

§

type Err = ParseIntError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for Date

source§

fn eq(&self, other: &Date) -> 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 Serialize for Date

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl ToString for Date

source§

fn to_string(&self) -> String

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

impl TryFrom<Date> for Date

§

type Error = ComponentRange

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

fn try_from(d: Date) -> Result<Self, Self::Error>

Performs the conversion.
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 Copy for Date

source§

impl StructuralPartialEq for Date

Auto Trait Implementations§

§

impl RefUnwindSafe for Date

§

impl Send for Date

§

impl Sync for Date

§

impl Unpin for Date

§

impl UnwindSafe for Date

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<S> ReadableRecord for S

source§

fn read_using<T, R>( field_iterator: &mut FieldIterator<'_, T, R> ) -> Result<S, FieldIOError>
where T: Read + Seek, R: Read + Seek,

function to be implemented that returns a new instance of your type using values read from the `FieldIterator’
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, 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.
source§

impl<T> WritableRecord for T
where T: Serialize,

source§

fn write_using<W, 'a>( &self, field_writer: &mut FieldWriter<'a, W> ) -> Result<(), FieldIOError>
where W: Write,

Use the FieldWriter to write the fields of the record
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,