pub struct PosixCustom(/* private fields */);
Expand description
A POSIX locale implementation of Custom
.
The behavior of the locale formatting of this type is meant to match that
of POSIX’s C
locale.
§Example
This example shows how to use PosixCustom
via strtime
formatting:
use jiff::{civil, fmt::strtime::{BrokenDownTime, PosixCustom, Config}};
let config = Config::new().custom(PosixCustom::new());
let dt = civil::date(2025, 7, 1).at(17, 30, 0, 0);
let tm = BrokenDownTime::from(dt);
assert_eq!(
tm.to_string_with_config(&config, "%c")?,
"Tue Jul 1 17:30:00 2025",
);
Implementations§
Source§impl PosixCustom
impl PosixCustom
Sourcepub const fn new() -> PosixCustom
pub const fn new() -> PosixCustom
Create a new instance of this POSIX customization.
Trait Implementations§
Source§impl Clone for PosixCustom
impl Clone for PosixCustom
Source§fn clone(&self) -> PosixCustom
fn clone(&self) -> PosixCustom
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Custom for PosixCustom
impl Custom for PosixCustom
Source§fn format_datetime<W: Write>(
&self,
config: &Config<Self>,
_ext: &Extension,
tm: &BrokenDownTime,
wtr: &mut W,
) -> Result<(), Error>
fn format_datetime<W: Write>( &self, config: &Config<Self>, _ext: &Extension, tm: &BrokenDownTime, wtr: &mut W, ) -> Result<(), Error>
Called when formatting a datetime with the
%c
flag. Read moreSource§fn format_date<W: Write>(
&self,
config: &Config<Self>,
_ext: &Extension,
tm: &BrokenDownTime,
wtr: &mut W,
) -> Result<(), Error>
fn format_date<W: Write>( &self, config: &Config<Self>, _ext: &Extension, tm: &BrokenDownTime, wtr: &mut W, ) -> Result<(), Error>
Called when formatting a datetime with the
%x
flag. Read moreSource§impl Debug for PosixCustom
impl Debug for PosixCustom
Source§impl Default for PosixCustom
impl Default for PosixCustom
Source§fn default() -> PosixCustom
fn default() -> PosixCustom
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PosixCustom
impl RefUnwindSafe for PosixCustom
impl Send for PosixCustom
impl Sync for PosixCustom
impl Unpin for PosixCustom
impl UnwindSafe for PosixCustom
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