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>

source

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 return Ok(()).
  • If max_width is insufficient even for the required part, return Err(N) where N 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>

source§

fn clone(&self) -> TreeHorizontalSlice<Name>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Name: Debug + Width> Debug for TreeHorizontalSlice<Name>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Name: Width> Display for TreeHorizontalSlice<Name>

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<Name: PartialEq + Width> PartialEq for TreeHorizontalSlice<Name>

source§

fn eq(&self, other: &TreeHorizontalSlice<Name>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Name: Width> Width for TreeHorizontalSlice<Name>

source§

fn width(&self) -> usize

Get width of the value.
source§

impl<Name: Eq + Width> Eq for TreeHorizontalSlice<Name>

source§

impl<Name: Width> StructuralPartialEq for TreeHorizontalSlice<Name>

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<X> Pipe for X

source§

fn pipe<Return, Function>(self, f: Function) -> Return
where Self: Sized, Function: FnOnce(Self) -> Return,

Apply f to self. Read more
source§

fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return
where Function: FnOnce(&'a Self) -> Return,

Apply f to &self. Read more
source§

fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return
where Function: FnOnce(&'a mut Self) -> Return,

Apply f to &mut self. Read more
source§

fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
where Self: AsRef<Param>, Param: 'a + ?Sized, Function: FnOnce(&'a Param) -> Return,

Apply f to &self where f takes a single parameter of type Param and Self implements trait AsRef<Param>. Read more
source§

fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
where Self: AsMut<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 AsMut<Param>. Read more
source§

fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
where Self: Deref<Target = Param>, Param: 'a + ?Sized, Function: FnOnce(&'a Param) -> Return,

Apply f to &self where f takes a single parameter of type Param and Self implements trait Deref<Target = Param>. Read more
source§

fn pipe_deref_mut<'a, Param, Return, Function>( &'a mut self, f: Function ) -> Return
where 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 more
source§

fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
where Self: Borrow<Param>, Param: 'a + ?Sized, Function: FnOnce(&'a Param) -> Return,

Apply f to &self where f takes a single parameter of type Param and Self implements trait Borrow<Param>. Read more
source§

fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function ) -> Return
where Self: BorrowMut<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 BorrowMut<Param>. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.