Struct PosixCustom
pub struct PosixCustom(/* private field */);
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",
);
# Ok::<(), Box<dyn std::error::Error>>(())
Implementations
impl PosixCustom
const fn new() -> PosixCustomCreate a new instance of this POSIX customization.
Trait Implementations
impl Clone for PosixCustom
fn clone(&self) -> Self
impl Custom for PosixCustom
fn format_datetime(&self, config: &Config<dyn Custom + '_>, ext: &Extension, tm: &BrokenDownTime, wtr: &mut dyn Write) -> Result<(), Error>fn format_date(&self, config: &Config<dyn Custom + '_>, _ext: &Extension, tm: &BrokenDownTime, wtr: &mut dyn Write) -> Result<(), Error>fn format_time(&self, config: &Config<dyn Custom + '_>, _ext: &Extension, tm: &BrokenDownTime, wtr: &mut dyn Write) -> Result<(), Error>fn format_12hour_time(&self, config: &Config<dyn Custom + '_>, ext: &Extension, tm: &BrokenDownTime, wtr: &mut dyn Write) -> Result<(), Error>
impl Debug for PosixCustom
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for PosixCustom
fn default() -> Self