Struct slicedisplay::SliceDisplayImpl
source · [−]pub struct SliceDisplayImpl<'a, T: Display> { /* private fields */ }
Expand description
Helper struct for printing Vecs and slices.
Implementations
sourceimpl<'a, T: Display> SliceDisplayImpl<'a, T>
impl<'a, T: Display> SliceDisplayImpl<'a, T>
sourcepub fn terminator(self, beginning: char, ending: char) -> Self
pub fn terminator(self, beginning: char, ending: char) -> Self
Configures the terminators to be used for the display.
Example
use slicedisplay::SliceDisplay;
let hello: Vec<_> = "Hello".chars().collect();
assert_eq!(hello.display().terminator('{', '}').to_string(), "{H, e, l, l, o}");
sourcepub fn delimiter(self, delimiter: char) -> Self
pub fn delimiter(self, delimiter: char) -> Self
Configures the delimiter to be used for the display.
Example
use slicedisplay::SliceDisplay;
let hello: Vec<_> = "Hello".chars().collect();
assert_eq!(hello.display().delimiter(';').to_string(), "[H; e; l; l; o]");
sourcepub fn should_space(self, should_space: bool) -> Self
pub fn should_space(self, should_space: bool) -> Self
Sets whether additional spacing should be added between elements.
True by default.
Example
use slicedisplay::SliceDisplay;
let hello: Vec<_> = "Hello".chars().collect();
assert_eq!(hello.display().delimiter(';').to_string(), "[H; e; l; l; o]");
assert_eq!(hello.display().delimiter(';').should_space(false).to_string(), "[H;e;l;l;o]");
Trait Implementations
sourceimpl<'a, T: Clone + Display> Clone for SliceDisplayImpl<'a, T>
impl<'a, T: Clone + Display> Clone for SliceDisplayImpl<'a, T>
sourcefn clone(&self) -> SliceDisplayImpl<'a, T>
fn clone(&self) -> SliceDisplayImpl<'a, T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a, T: Display> Display for SliceDisplayImpl<'a, T>
impl<'a, T: Display> Display for SliceDisplayImpl<'a, T>
impl<'a, T: Copy + Display> Copy for SliceDisplayImpl<'a, T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for SliceDisplayImpl<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for SliceDisplayImpl<'a, T> where
T: Sync,
impl<'a, T> Sync for SliceDisplayImpl<'a, T> where
T: Sync,
impl<'a, T> Unpin for SliceDisplayImpl<'a, T>
impl<'a, T> UnwindSafe for SliceDisplayImpl<'a, T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more