Struct parallel_disk_usage::visualizer::tree::TreeHorizontalSlice
source · pub struct TreeHorizontalSlice<Name: Width> { /* private fields */ }
Expand description
Horizontal slice of a tree of the height of exactly 1 line of text.
Implementations§
source§impl TreeHorizontalSlice<String>
impl TreeHorizontalSlice<String>
sourcepub fn truncate(&mut self, max_width: usize) -> Result<(), usize>
pub fn truncate(&mut self, max_width: usize) -> Result<(), usize>
Truncate the name to fit specified max_width
.
- If
max_width
is already sufficient, do nothing other than returnOk(())
. - If
max_width
is insufficient even for the required part, returnErr(N)
whereN
is the required width. - If
max_width
is sufficient for the required part but insufficient for the name, truncate and add"..."
to the name.
Trait Implementations§
source§impl<Name: Clone + Width> Clone for TreeHorizontalSlice<Name>
impl<Name: Clone + Width> Clone for TreeHorizontalSlice<Name>
source§fn clone(&self) -> TreeHorizontalSlice<Name>
fn clone(&self) -> TreeHorizontalSlice<Name>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Name: Width> Display for TreeHorizontalSlice<Name>
impl<Name: Width> Display for TreeHorizontalSlice<Name>
source§impl<Name: PartialEq + Width> PartialEq for TreeHorizontalSlice<Name>
impl<Name: PartialEq + Width> PartialEq for TreeHorizontalSlice<Name>
source§fn eq(&self, other: &TreeHorizontalSlice<Name>) -> bool
fn eq(&self, other: &TreeHorizontalSlice<Name>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Name: Width> Width for TreeHorizontalSlice<Name>
impl<Name: Width> Width for TreeHorizontalSlice<Name>
impl<Name: Eq + Width> Eq for TreeHorizontalSlice<Name>
impl<Name: Width> StructuralPartialEq for TreeHorizontalSlice<Name>
Auto Trait Implementations§
impl<Name> Freeze for TreeHorizontalSlice<Name>where
Name: Freeze,
impl<Name> RefUnwindSafe for TreeHorizontalSlice<Name>where
Name: RefUnwindSafe,
impl<Name> Send for TreeHorizontalSlice<Name>where
Name: Send,
impl<Name> Sync for TreeHorizontalSlice<Name>where
Name: Sync,
impl<Name> Unpin for TreeHorizontalSlice<Name>where
Name: Unpin,
impl<Name> UnwindSafe for TreeHorizontalSlice<Name>where
Name: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<X> Pipe for X
impl<X> Pipe for X
source§fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
source§fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f
to &self
where f
takes a single parameter of type Param
and Self
implements trait AsRef<Param>
. Read moresource§fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
Apply
f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait AsMut<Param>
. Read moresource§fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Deref<Target = Param>
. Read moresource§fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait [DerefMut<Target = Param>
]. Read moresource§fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f
to &self
where f
takes a single parameter of type Param
and Self
implements trait Borrow<Param>
. Read moresource§fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Return
fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function, ) -> Return
Apply
f
to &mut self
where f
takes a single parameter of type Param
and Self
implements trait BorrowMut<Param>
. Read more