pub(super) struct SpanPrinter {
lowercase: bool,
}
Expand description
A printer for Temporal spans.
Note that in Temporal, a “span” is called a “duration.”
Fields§
§lowercase: bool
Whether to use lowercase unit designators.
Implementations§
Source§impl SpanPrinter
impl SpanPrinter
Sourcepub(super) const fn new() -> SpanPrinter
pub(super) const fn new() -> SpanPrinter
Create a new Temporal span printer with the default configuration.
Sourcepub(super) const fn lowercase(self, yes: bool) -> SpanPrinter
pub(super) const fn lowercase(self, yes: bool) -> SpanPrinter
Use lowercase for unit designator labels.
By default, unit designator labels are written in uppercase.
Sourcepub(super) fn print_span<W: Write>(
&self,
span: &Span,
wtr: W,
) -> Result<(), Error>
pub(super) fn print_span<W: Write>( &self, span: &Span, wtr: W, ) -> Result<(), Error>
Print the given span to the writer given.
This only returns an error when the given writer returns an error.
Sourcepub(super) fn print_duration<W: Write>(
&self,
dur: &SignedDuration,
wtr: W,
) -> Result<(), Error>
pub(super) fn print_duration<W: Write>( &self, dur: &SignedDuration, wtr: W, ) -> Result<(), Error>
Print the given signed duration to the writer given.
This only returns an error when the given writer returns an error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpanPrinter
impl RefUnwindSafe for SpanPrinter
impl Send for SpanPrinter
impl Sync for SpanPrinter
impl Unpin for SpanPrinter
impl UnwindSafe for SpanPrinter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more