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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a, T: 'a + Display> Display for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, T: 'a + Debug> Debug for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + Binary> Binary for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + Octal> Octal for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + LowerHex> LowerHex for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + UpperHex> UpperHex for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + LowerExp> LowerExp for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + UpperExp> UpperExp for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: 'a + Pointer> Pointer for CommaSeparated<'a, T>
[src]

[src]

Formats the value using the given formatter.