#[allow(unused_imports)]
use crate::prelude::*;
pub trait Format {}
macro_rules! impl_format {
($(#[$attr:meta] $t:ty)*) => {
$(
#[$attr]
impl Format for $t {}
)*
};
}
macro_rules! create_format {
($(#[$attr:meta] $t:ident)*) => {
$(
#[$attr]
pub struct $t;
impl_format!(#[$attr] $t);
)*
};
}
impl_format!(
i8
u8
i16
u16
i32
u32
i64
u64
i128
u128
f32
f64
bool
);
#[cfg(feature = "alloc")]
impl_format!(
String
);
create_format!(
Uppercase
Lowercase
PreferOne
PreferMany
Padded
Unpadded
);
pub trait Strictness {}
pub struct Strict;
impl Strictness for Strict {}
pub struct Flexible;
impl Strictness for Flexible {}
pub trait Separator {
fn separator() -> &'static str;
}
pub struct SpaceSeparator;
impl Separator for SpaceSeparator {
#[inline]
fn separator() -> &'static str {
" "
}
}
pub struct CommaSeparator;
impl Separator for CommaSeparator {
#[inline]
fn separator() -> &'static str {
","
}
}
pub struct SemicolonSeparator;
impl Separator for SemicolonSeparator {
#[inline]
fn separator() -> &'static str {
";"
}
}
pub struct ColonSeparator;
impl Separator for ColonSeparator {
#[inline]
fn separator() -> &'static str {
":"
}
}