Struct std::fmt::Format

Overview

A format specification, wrapping an inner value.

Trait Implementations

impl Clone for Format
fn clone(value: any) -> any

Clone the specified value.

Examples

let a = 42;
let b = a;
let c = a.clone();

a += 1;

assert_eq!(a, 43);
assert_eq!(b, 42);
assert_eq!(c, 42);

Protocols

protocol DISPLAY_FMT
format!("{}", value)

Write a display representation of a format specification.

Examples

let value = #[builtin] format!("Hello", fill = '0', width = 10);
assert_eq!(format!("{value}"), "Hello00000");
protocol DEBUG_FMT
format!("{:?}", value)

Write a debug representation of a format specification.

Examples

let value = #[builtin] format!("Hello", fill = '0', width = 10);
let string = format!("{value:?}");
assert!(string is String);
protocol CLONE
let $out = clone(value)

Clones a format specification.

Examples

let value = #[builtin] format!("Hello", fill = '0', width = 10);
let vlaue2 = value.clone();
assert_eq!(format!("{value}"), "Hello00000");