Error in alloc::fmt - Rust
Description: The error type which is returned from formatting a message into a stream.
Keywords: rust, rustlang, rust-lang, Error

# Struct alloc::fmt::Error
1.0.0[−][src]

    pub struct Error;

Expand description

The error type which is returned from formatting a message into a stream.

This type does not support transmission of an error other than that an error occurred. Any extra information must be arranged to be transmitted through some other means.

An important thing to remember is that the type `fmt::Error` should not be confused with `std::io::Error` or `std::error::Error`, which you may also have in scope.

# Examples

    use std::fmt::{self, write};

    let mut output = String::new();
    if let Err(fmt::Error) = write(&mut output, format_args!("Hello {}!", "world")) {
        panic!("An error occurred");
    }

Run

## Trait Implementations

[src]

### impl Clone for Error

[src]

#### pub fn clone(&self) -> Error

Returns a copy of the value. Read more

[src]

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

Performs copy-assignment from `source`. Read more

[src]

### impl Debug for Error

[src]

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

Formats the value using the given formatter. Read more

[src]

### impl Default for Error

[src]

#### pub fn default() -> Error

Returns the “default value” for a type. Read more

[src]

### impl Display for Error

[src]

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

Formats the value using the given formatter. Read more

[src]

### impl Hash for Error

[src]

#### pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,

Feeds this value into the given `Hasher`. Read more

1.3.0[src]

#### fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,

Feeds a slice of this type into the given `Hasher`. Read more

[src]

### impl Ord for Error

[src]

#### pub fn cmp(&self, other: &Error) -> Ordering

This method returns an `Ordering` between `self` and `other`. Read more

1.21.0[src]

#### fn max(self, other: Self) -> Self

Compares and returns the maximum of two values. Read more

1.21.0[src]

#### fn min(self, other: Self) -> Self

Compares and returns the minimum of two values. Read more

1.50.0[src]

#### fn clamp(self, min: Self, max: Self) -> Self

Restrict a value to a certain interval. Read more

[src]

### impl PartialEq<Error> for Error

[src]

#### pub fn eq(&self, other: &Error) -> bool

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

[src]

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

This method tests for `!=`.

[src]

### impl PartialOrd<Error> for Error

[src]

#### pub fn partial_cmp(&self, other: &Error) -> Option<Ordering>

This method returns an ordering between `self` and `other` values if one exists. Read more

[src]

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

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

[src]

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

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

[src]

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

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

[src]

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

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

[src]

### impl Copy for Error

[src]

### impl Eq for Error

[src]

### impl StructuralEq for Error

[src]

### impl StructuralPartialEq for Error

## Auto Trait Implementations

### impl RefUnwindSafe for Error

### impl Send for Error

### impl Sync for Error

### impl Unpin for Error

### impl UnwindSafe for Error

## Blanket Implementations

[src]

### impl<T> Any for T where
T: 'static + ?Sized,

[src]

#### pub fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more

[src]

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

[src]

#### pub fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

[src]

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

[src]

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

Mutably borrows from an owned value. Read more

[src]

### impl<T> From<T> for T

[src]

#### pub fn from(t: T) -> T

Performs the conversion.

[src]

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

[src]

#### pub fn into(self) -> U

Performs the conversion.

[src]

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

#### type Owned = T

The resulting type after obtaining ownership.

[src]

#### pub fn to_owned(&Self) -> T

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

[src]

#### pub fn clone_into(&Self, &mut T)

🔬 This is a nightly-only experimental API. (`toowned_clone_into` #41263)

recently added

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

[src]

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

[src]

#### pub default fn to_string(&Self) -> String

Converts the given value to a `String`. Read more

[src]

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

#### type Error = Infallible

The type returned in the event of a conversion error.

[src]

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

Performs the conversion.

[src]

### 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.

[src]

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

Performs the conversion.