Skip to main content

Displayable

Struct Displayable 

Source
pub struct Displayable<'value, CD, B>
where CD: CustomDisplay + ?Sized, B: Borrow<CD>,
{ /* private fields */ }
Expand description

A wrapper around a CustomDisplay and a value that implements Display by calling CustomDisplay::fmt() with the value, automatically truncates the result of CustomDisplay::fmt() based on precision if CustomDisplay::precision_behavior() returns AutoTruncate, and handles width, fill and alignment if CustomDisplay::auto_width_fill_alignment() returns true.

Trait Implementations§

Source§

impl<'value, CD, B> Clone for Displayable<'value, CD, B>
where CD: CustomDisplay + ?Sized + Clone, B: Borrow<CD> + Clone, CD::Value: Clone,

Source§

fn clone(&self) -> Displayable<'value, CD, B>

Returns a duplicate 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<'value, CD, B> Debug for Displayable<'value, CD, B>
where CD: CustomDisplay + ?Sized + Debug, B: Borrow<CD> + Debug, CD::Value: Debug,

Source§

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

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

impl<CD, B> Display for Displayable<'_, CD, B>
where CD: CustomDisplay + ?Sized, B: Borrow<CD>,

Source§

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

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

impl<'value, CD, B> Copy for Displayable<'value, CD, B>
where CD: CustomDisplay + ?Sized + Copy, B: Borrow<CD> + Copy, CD::Value: Copy,

Auto Trait Implementations§

§

impl<'value, CD, B> Freeze for Displayable<'value, CD, B>
where B: Freeze, CD: ?Sized,

§

impl<'value, CD, B> RefUnwindSafe for Displayable<'value, CD, B>

§

impl<'value, CD, B> Send for Displayable<'value, CD, B>
where B: Send, <CD as CustomDisplay>::Value: Sync, CD: ?Sized,

§

impl<'value, CD, B> Sync for Displayable<'value, CD, B>
where B: Sync, <CD as CustomDisplay>::Value: Sync, CD: ?Sized,

§

impl<'value, CD, B> Unpin for Displayable<'value, CD, B>
where B: Unpin, CD: ?Sized,

§

impl<'value, CD, B> UnsafeUnpin for Displayable<'value, CD, B>
where B: UnsafeUnpin, CD: ?Sized,

§

impl<'value, CD, B> UnwindSafe for Displayable<'value, CD, B>
where B: UnwindSafe, <CD as CustomDisplay>::Value: RefUnwindSafe, CD: ?Sized,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> ToOwned for T
where T: Clone,

Source§

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§

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>,

Source§

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>,

Source§

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.