start copying from std

This commit is contained in:
nora 2022-09-13 16:30:04 +02:00
parent dd9c6aa770
commit 505a8f80d5
5 changed files with 824 additions and 29 deletions

View file

@ -2,6 +2,7 @@
mod args;
mod opts;
mod std_impl;
mod write;
#[macro_export]
@ -54,6 +55,25 @@ pub trait Display {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub trait Binary {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub trait Octal {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub trait LowerHex {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub trait UpperHex {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub trait UpperExp {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub trait LowerExp {
fn fmt<W: Write, O: FmtOpts>(&self, f: &mut Formatter<W, O>) -> Result;
}
pub struct Formatter<W, O> {
buf: W,
opts: O,