Struct srcerr::fmt::Code[][src]

pub struct Code<E>(_);

Formatting helpers for writing notes with consistent sentences.

Implementations

impl<E> Code<E> where
    E: ErrorCode
[src]

pub fn string(error_code: E) -> String[src]

Returns a String representing the error code.

See Self::fmt_string for a non-allocating version of this.

Parameters

  • error_code: The error code.

pub fn fmt_string(buffer: &mut String, error_code: E) -> Result<(), Error>[src]

Writes the error code into the buffer.

See Self::string for a version that allocates a String.

Parameters

  • buffer: The buffer to write into.
  • error_code: The error code.

pub fn digits(value_max: usize) -> usize[src]

Returns the number of digits that the given max value fits into.

Trait Implementations

impl<E: Debug> Debug for Code<E>[src]

Auto Trait Implementations

impl<E> RefUnwindSafe for Code<E> where
    E: RefUnwindSafe

impl<E> Send for Code<E> where
    E: Send

impl<E> Sync for Code<E> where
    E: Sync

impl<E> Unpin for Code<E> where
    E: Unpin

impl<E> UnwindSafe for Code<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.