pub struct DisplaySlice<'a, T: Display> { /* private fields */ }Expand description
Implement Display for &[T] if T is Display.
It outputs at most limit elements, excluding those from the 5th to the second-to-last one:
DisplaySlice{ slice: &[1,2,3,4,5,6], ...}outputs:"[1,2,3,4,...,6]".
Implementations§
Source§impl<'a, T: Display> DisplaySlice<'a, T>
impl<'a, T: Display> DisplaySlice<'a, T>
pub fn new(slice: &'a [T]) -> Self
pub fn at_most(self, limit: Option<usize>) -> Self
pub fn sep(self, separator: &'a str) -> Self
pub fn braces(self, left: &'a str, right: &'a str) -> Self
pub fn ellipsis(self, s: &'a str) -> Self
pub fn elem(self, prefix: &'a str, suffix: &'a str) -> Self
pub fn show_count(self) -> Self
pub fn limit(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for DisplaySlice<'a, T>
impl<'a, T> RefUnwindSafe for DisplaySlice<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DisplaySlice<'a, T>where
T: Sync,
impl<'a, T> Sync for DisplaySlice<'a, T>where
T: Sync,
impl<'a, T> Unpin for DisplaySlice<'a, T>
impl<'a, T> UnsafeUnpin for DisplaySlice<'a, T>
impl<'a, T> UnwindSafe for DisplaySlice<'a, T>where
T: RefUnwindSafe,
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