Trait reparser::def::Display1.0.0[][src]

pub trait Display {
    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>;
}
Expand description

Format trait for an empty format, {}.

Display is similar to Debug, but Display is for user-facing output, and so cannot be derived.

For more information on formatters, see the module-level documentation.

Examples

Implementing Display on a type:

use std::fmt;

struct Point {
    x: i32,
    y: i32,
}

impl fmt::Display for Point {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "({}, {})", self.x, self.y)
    }
}

let origin = Point { x: 0, y: 0 };

assert_eq!(format!("The origin is: {}", origin), "The origin is: (0, 0)");

Required methods

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

Expand description

Formats the value using the given formatter.

Examples

use std::fmt;

struct Position {
    longitude: f32,
    latitude: f32,
}

impl fmt::Display for Position {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "({}, {})", self.longitude, self.latitude)
    }
}

assert_eq!("(1.987, 2.983)",
           format!("{}", Position { longitude: 1.987, latitude: 2.983, }));

Implementations on Foreign Types

impl Display for RecvTimeoutError[src]

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

impl Display for AccessError[src]

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

impl Display for TryRecvError[src]

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

impl Display for StripPrefixError[src]

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

impl Display for RecvError[src]

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

impl Display for Backtrace[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<T> Display for TryLockError<T>[src]

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

impl Display for Ipv6Addr[src]

Write an Ipv6Addr, conforming to the canonical style described by RFC 5952.

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

impl<T> Display for PoisonError<T>[src]

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

impl Display for AddrParseError[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for JoinPathsError[src]

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

impl Display for SocketAddr[src]

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

impl<'_, T> Display for RwLockReadGuard<'_, T> where
    T: Display + ?Sized
[src]

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

impl Display for NulError[src]

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

impl<'_> Display for Display<'_>[src]

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

impl Display for Ipv4Addr[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for SocketAddrV6[src]

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

impl<T> Display for SendError<T>[src]

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

impl Display for ExitStatus[src]

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

impl<'_, T> Display for RwLockWriteGuard<'_, T> where
    T: Display + ?Sized
[src]

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

impl Display for IntoStringError[src]

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

impl Display for VarError[src]

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

impl Display for FromVecWithNulError[src]

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

impl<T> Display for TrySendError<T>[src]

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

impl<'a, K, V> Display for OccupiedError<'a, K, V> where
    K: Debug,
    V: Debug
[src]

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

impl<'_, T> Display for MutexGuard<'_, T> where
    T: Display + ?Sized
[src]

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

impl Display for SocketAddrV4[src]

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

impl Display for IpAddr[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for SystemTimeError[src]

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

impl Display for FromBytesWithNulError[src]

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

impl Display for NonZeroI16[src]

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

impl Display for NonZeroU32[src]

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

impl Display for BorrowMutError[src]

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

impl Display for bool[src]

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

impl Display for u64[src]

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

impl Display for char[src]

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

impl<'a> Display for EscapeUnicode<'a>[src]

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

impl<'a> Display for EscapeDebug<'a>[src]

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

impl Display for i32[src]

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

impl Display for u8[src]

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

impl Display for EscapeDebug[src]

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

impl<T> Display for Wrapping<T> where
    T: Display
[src]

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

impl Display for Utf8Lossy[src]

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

impl Display for AllocError[src]

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

impl Display for NonZeroI128[src]

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

impl Display for NonZeroU64[src]

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

impl Display for NonZeroUsize[src]

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

impl Display for NonZeroU8[src]

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

impl Display for NonZeroU128[src]

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

impl Display for ParseBoolError[src]

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

impl Display for i16[src]

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

impl Display for u16[src]

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

impl Display for u32[src]

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

impl Display for EscapeUnicode[src]

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

impl Display for NonZeroI8[src]

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

impl Display for NonZeroU16[src]

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

impl Display for EscapeDefault[src]

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

impl<'_, T> Display for &'_ mut T where
    T: Display + ?Sized
[src]

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

impl Display for ToUppercase[src]

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

impl Display for ToLowercase[src]

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

impl Display for Error[src]

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

impl Display for NonZeroIsize[src]

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

impl Display for DecodeUtf16Error[src]

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

impl<P> Display for Pin<P> where
    P: Display
[src]

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

impl Display for ![src]

pub fn fmt(&self, &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for ParseIntError[src]

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

impl<'_, T> Display for Ref<'_, T> where
    T: Display + ?Sized
[src]

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

impl Display for LayoutError[src]

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

impl Display for str[src]

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

impl<'_, T> Display for &'_ T where
    T: Display + ?Sized
[src]

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

impl Display for Infallible[src]

pub fn fmt(&self, &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for i8[src]

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

impl Display for isize[src]

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

impl Display for i128[src]

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

impl Display for NonZeroI32[src]

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

impl Display for usize[src]

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

impl<'_> Display for PanicInfo<'_>[src]

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

impl Display for BorrowError[src]

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

impl Display for f32[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for f64[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for NonZeroI64[src]

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

impl<'_> Display for Location<'_>[src]

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

impl<'_> Display for Arguments<'_>[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for Utf8Error[src]

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

impl Display for CharTryFromError[src]

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

impl<'a> Display for EscapeAscii<'a>[src]

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

impl Display for ParseCharError[src]

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

impl Display for TryFromSliceError[src]

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

impl Display for EscapeDefault[src]

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

impl Display for u128[src]

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

impl Display for TryFromIntError[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl Display for ParseFloatError[src]

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

impl<'_, T> Display for RefMut<'_, T> where
    T: Display + ?Sized
[src]

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

impl<'a> Display for EscapeDefault<'a>[src]

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

impl Display for i64[src]

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

impl<T> Display for Arc<T> where
    T: Display + ?Sized
[src]

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

impl<T, A> Display for Box<T, A> where
    T: Display + ?Sized,
    A: Allocator
[src]

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

impl<'_, B> Display for Cow<'_, B> where
    B: Display + ToOwned + ?Sized,
    <B as ToOwned>::Owned: Display
[src]

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

impl Display for String[src]

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

impl Display for FromUtf16Error[src]

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

impl Display for FromUtf8Error[src]

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

impl<'a, K, V> Display for OccupiedError<'a, K, V> where
    K: Debug + Ord,
    V: Debug
[src]

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

impl Display for TryReserveError[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<L, T, E> Display for ParseError<L, T, E> where
    T: Display,
    E: Display,
    L: Display
[src]

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

impl<'a> Display for Token<'a>[src]

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

impl Display for Error

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

impl Display for Regex

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

Shows the original regular expression.

impl Display for Regex

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

Shows the original regular expression.

impl Display for Error

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

impl Display for ErrorKind

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

impl Display for CaseFoldError

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

impl Display for Error

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

impl Display for ErrorKind

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

impl Display for Ast

Print a display representation of this Ast.

This does not preserve any of the original whitespace formatting that may have originally been present in the concrete syntax from which this Ast was generated.

This implementation uses constant stack space and heap space proportional to the size of the Ast.

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

impl Display for Error

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

impl Display for UnicodeWordError

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

impl Display for Hir

Print a display representation of this Hir.

The result of this is a valid regular expression pattern string.

This implementation uses constant stack space and heap space proportional to the size of the Hir.

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

impl Display for Error

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

Implementors

impl Display for reparser::def::io::Error[src]

pub fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

impl<T> Display for Rc<T> where
    T: Display + ?Sized
[src]

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

impl<W> Display for IntoInnerError<W>[src]

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