Struct pdf_writer::Date
source · [−]pub struct Date { /* private fields */ }
Expand description
A date, represented as a text string.
A field is only respected if all superior fields are supplied. For example,
to set the minute, the hour, day, etc. have to be set. Similarly, in order
for the time zone information to be written, all time information (including
seconds) must be written. utc_offset_minute
is optional if supplying time
zone info. It must only be used to specify sub-hour time zone offsets.
Implementations
sourceimpl Date
impl Date
sourcepub fn new(year: u16) -> Self
pub fn new(year: u16) -> Self
Create a new, minimal date. The year will be clamped within the range 0-9999.
sourcepub fn month(self, month: u8) -> Self
pub fn month(self, month: u8) -> Self
Add the month field. It will be clamped within the range 1-12.
sourcepub fn hour(self, hour: u8) -> Self
pub fn hour(self, hour: u8) -> Self
Add the hour field. It will be clamped within the range 0-23.
sourcepub fn minute(self, minute: u8) -> Self
pub fn minute(self, minute: u8) -> Self
Add the minute field. It will be clamped within the range 0-59.
sourcepub fn second(self, second: u8) -> Self
pub fn second(self, second: u8) -> Self
Add the second field. It will be clamped within the range 0-59.
sourcepub fn utc_offset_hour(self, hour: i8) -> Self
pub fn utc_offset_hour(self, hour: i8) -> Self
Add the offset from UTC in hours. If not specified, the time will be assumed to be local to the viewer’s time zone. It will be clamped within the range -23-23.
sourcepub fn utc_offset_minute(self, minute: u8) -> Self
pub fn utc_offset_minute(self, minute: u8) -> Self
Add the offset from UTC in minutes. This will have the same sign as set in
Self::utc_offset_hour
. It will be clamped within the range 0-59.
Trait Implementations
impl Copy for Date
impl Eq for Date
impl StructuralEq for Date
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more