Struct extfmt::CommaSeparated
[−]
[src]
pub struct CommaSeparated<'a, T: 'a>(pub &'a [T]);
Format a slice in a Rust syntax. Supports formatting using the following traits: - Display - Debug - Binary - Octal - LowerHex, UpperHex - LowerExp, UpperExp - Pointer
Examples
use extfmt::*; assert_eq!(format!("{}", CommaSeparated(&[1, 2, 3])), "[1, 2, 3]"); assert_eq!(format!("{:x}", CommaSeparated(&[122, 123, 134])), "[7a, 7b, 86]"); assert_eq!(format!("{:#o}", CommaSeparated(&[122, 123, 134])), "[0o172, 0o173, 0o206]");
Trait Implementations
impl<'a, T: Clone + 'a> Clone for CommaSeparated<'a, T>
[src]
fn clone(&self) -> CommaSeparated<'a, T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, T: 'a + Display> Display for CommaSeparated<'a, T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more