Struct DefaultCustom

pub struct DefaultCustom(/* private field */);

The default trait implementation of Custom.

Whenever one uses the formatting or parsing routines in this module without providing a configuration, then this customization is the one that gets used.

The behavior of the locale formatting of this type is meant to match that of Unicode's und locale.

Example

This example shows how to explicitly use DefaultCustom via strtime formatting:

use jiff::{civil, fmt::strtime::{BrokenDownTime, DefaultCustom, Config}};

let config = Config::new().custom(DefaultCustom::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")?,
    "2025 M07 1, Tue 17:30:00",
);

# Ok::<(), Box<dyn std::error::Error>>(())

Implementations

impl DefaultCustom

const fn new() -> DefaultCustom

Create a new instance of this default customization.

Trait Implementations

impl Clone for DefaultCustom

fn clone(&self) -> DefaultCustom

impl Custom for DefaultCustom

impl Debug for DefaultCustom

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

impl Default for DefaultCustom

fn default() -> DefaultCustom

Auto Trait Implementations

impl Freeze for DefaultCustom

impl RefUnwindSafe for DefaultCustom

impl Send for DefaultCustom

impl Sync for DefaultCustom

impl Unpin for DefaultCustom

impl UnsafeUnpin for DefaultCustom

impl UnwindSafe for DefaultCustom

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for DefaultCustom

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for DefaultCustom 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 DefaultCustom 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 DefaultCustom where U: TryFrom<T>,

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