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() -> PosixCustom

Create a new instance of this POSIX customization.

Trait Implementations

impl Clone for PosixCustom

fn clone(&self) -> PosixCustom

impl Custom for PosixCustom

fn format_datetime<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>
fn format_time<W: Write>(&self, config: &Config<Self>, _ext: &Extension, tm: &BrokenDownTime, wtr: &mut W) -> Result<(), Error>
fn format_12hour_time<W: Write>(&self, config: &Config<Self>, ext: &Extension, tm: &BrokenDownTime, wtr: &mut W) -> Result<(), Error>

impl Debug for PosixCustom

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

impl Default for PosixCustom

fn default() -> PosixCustom

Auto Trait Implementations

impl Freeze for PosixCustom

impl RefUnwindSafe for PosixCustom

impl Send for PosixCustom

impl Sync for PosixCustom

impl Unpin for PosixCustom

impl UnsafeUnpin for PosixCustom

impl UnwindSafe for PosixCustom

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for PosixCustom where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for PosixCustom

fn from(t: T) -> T

Returns the argument unchanged.

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

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

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

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