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

Format trait for an empty format, {}.

Implementing this trait for a type will automatically implement the ToString trait for the type, allowing the usage of the .to_string() method. Prefer implementing the Display trait for a type, rather than ToString.

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§

source

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

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, }));

Implementors§

source§

impl Display for InvokeError<WasmRuntimeError>

source§

impl Display for RejectionReason

source§

impl Display for RuntimeError

source§

impl Display for AbortReason

source§

impl Display for WasmRuntimeError

source§

impl Display for AddressBech32DecodeError

source§

impl Display for AddressBech32EncodeError

source§

impl Display for DateTimeError

source§

impl Display for Level

source§

impl Display for NonFungibleLocalId

source§

impl Display for ParseBlsPublicKeyError

source§

impl Display for ParseBlsSignatureError

source§

impl Display for ParseComponentAddressError

source§

impl Display for ParseDecimalError

source§

impl Display for ParseEd25519PublicKeyError

source§

impl Display for ParseEd25519SignatureError

§

impl Display for ParseError

source§

impl Display for ParseGlobalAddressError

source§

impl Display for ParseHashError

source§

impl Display for ParseI192Error

source§

impl Display for ParseI256Error

source§

impl Display for ParseI320Error

source§

impl Display for ParseI384Error

source§

impl Display for ParseI448Error

source§

impl Display for ParseI512Error

source§

impl Display for ParseI768Error

source§

impl Display for ParseInternalAddressError

source§

impl Display for ParseManifestAddressReservationError

source§

impl Display for ParseManifestBlobRefError

source§

impl Display for ParseManifestBucketError

source§

impl Display for ParseManifestDecimalError

source§

impl Display for ParseManifestExpressionError

source§

impl Display for ParseManifestPreciseDecimalError

source§

impl Display for ParseManifestProofError

source§

impl Display for ParseNonFungibleGlobalIdError

source§

impl Display for ParseNonFungibleLocalIdError

source§

impl Display for ParseOwnError

source§

impl Display for ParsePackageAddressError

source§

impl Display for ParsePreciseDecimalError

source§

impl Display for ParseReferenceError

source§

impl Display for ParseResourceAddressError

source§

impl Display for ParseSecp256k1PublicKeyError

source§

impl Display for ParseSecp256k1SignatureError

source§

impl Display for ParseU192Error

source§

impl Display for ParseU256Error

source§

impl Display for ParseU320Error

source§

impl Display for ParseU384Error

source§

impl Display for ParseU448Error

source§

impl Display for ParseU512Error

source§

impl Display for ParseU768Error

source§

impl Display for ParseUtcDateTimeError

1.34.0 · source§

impl Display for Infallible

1.15.0 · source§

impl Display for radix_engine::types::radix_engine_common::prelude::rust::sync::mpsc::RecvTimeoutError

source§

impl Display for radix_engine::types::radix_engine_common::prelude::rust::sync::mpsc::TryRecvError

source§

impl Display for AsciiChar

1.7.0 · source§

impl Display for IpAddr

source§

impl Display for SocketAddr

1.29.0 · source§

impl Display for proc_macro::TokenTree

Prints the token tree as a string that is supposed to be losslessly convertible back into the same token tree (modulo spans), except for possibly TokenTree::Groups with Delimiter::None delimiters and negative numeric literals.

Note: the exact form of the output is subject to change, e.g. there might be changes in the whitespace used between tokens. Therefore, you should not do any kind of simple substring matching on the output string (as produced by to_string) to implement a proc macro, because that matching might stop working if such changes happen. Instead, you should work at the TokenTree level, e.g. matching against TokenTree::Ident, TokenTree::Punct, or TokenTree::Literal.

source§

impl Display for VarError

1.60.0 · source§

impl Display for std::io::error::ErrorKind

source§

impl Display for FromHexError

source§

impl Display for proc_macro2::TokenTree

Prints the token tree as a string that is supposed to be losslessly convertible back into the same token tree (modulo spans), except for possibly TokenTree::Groups with Delimiter::None delimiters and negative numeric literals.

source§

impl Display for Variant

source§

impl Display for BernoulliError

source§

impl Display for WeightedError

source§

impl Display for bool

source§

impl Display for char

source§

impl Display for f32

source§

impl Display for f64

source§

impl Display for i8

source§

impl Display for i16

source§

impl Display for i32

source§

impl Display for i64

source§

impl Display for i128

source§

impl Display for isize

source§

impl Display for !

source§

impl Display for str

source§

impl Display for u8

source§

impl Display for u16

source§

impl Display for u32

source§

impl Display for u64

source§

impl Display for u128

source§

impl Display for usize

source§

impl Display for Bls12381G1PublicKey

source§

impl Display for Bls12381G2Signature

1.13.0 · source§

impl Display for BorrowError

1.13.0 · source§

impl Display for BorrowMutError

source§

impl Display for Decimal

source§

impl Display for Ed25519PublicKey

source§

impl Display for Ed25519Signature

source§

impl Display for Hash

source§

impl Display for I192

source§

impl Display for I256

source§

impl Display for I320

source§

impl Display for I384

source§

impl Display for I448

source§

impl Display for I512

source§

impl Display for I768

source§

impl Display for PreciseDecimal

source§

impl Display for Secp256k1PublicKey

source§

impl Display for Secp256k1Signature

source§

impl Display for String

source§

impl Display for U192

source§

impl Display for U256

source§

impl Display for U320

source§

impl Display for U384

source§

impl Display for U448

source§

impl Display for U512

source§

impl Display for U768

source§

impl Display for UtcDateTime

source§

impl Display for UnorderedKeyError

source§

impl Display for Arguments<'_>

source§

impl Display for radix_engine::types::radix_engine_common::prelude::fmt::Error

source§

impl Display for radix_engine::types::radix_engine_common::prelude::indexmap::TryReserveError

source§

impl Display for AllocError

1.28.0 · source§

impl Display for LayoutError

1.34.0 · source§

impl Display for NonZero<i8>

1.34.0 · source§

impl Display for NonZero<i16>

1.34.0 · source§

impl Display for NonZero<i32>

1.34.0 · source§

impl Display for NonZero<i64>

1.34.0 · source§

impl Display for NonZero<i128>

1.34.0 · source§

impl Display for NonZero<isize>

1.28.0 · source§

impl Display for NonZero<u8>

1.28.0 · source§

impl Display for NonZero<u16>

1.28.0 · source§

impl Display for NonZero<u32>

1.28.0 · source§

impl Display for NonZero<u64>

1.28.0 · source§

impl Display for NonZero<u128>

1.28.0 · source§

impl Display for NonZero<usize>

source§

impl Display for radix_engine::types::radix_engine_common::prelude::rust::num::ParseFloatError

source§

impl Display for radix_engine::types::radix_engine_common::prelude::rust::num::ParseIntError

1.34.0 · source§

impl Display for radix_engine::types::radix_engine_common::prelude::rust::num::TryFromIntError

source§

impl Display for ParseBoolError

source§

impl Display for Utf8Error

source§

impl Display for FromUtf8Error

source§

impl Display for FromUtf16Error

source§

impl Display for radix_engine::types::radix_engine_common::prelude::rust::sync::mpsc::RecvError

1.57.0 · source§

impl Display for alloc::collections::TryReserveError

1.58.0 · source§

impl Display for FromVecWithNulError

1.7.0 · source§

impl Display for IntoStringError

source§

impl Display for NulError

1.36.0 · source§

impl Display for TryFromSliceError

1.39.0 · source§

impl Display for core::ascii::EscapeDefault

1.34.0 · source§

impl Display for CharTryFromError

1.20.0 · source§

impl Display for ParseCharError

1.9.0 · source§

impl Display for DecodeUtf16Error

1.20.0 · source§

impl Display for core::char::EscapeDebug

1.16.0 · source§

impl Display for core::char::EscapeDefault

1.16.0 · source§

impl Display for core::char::EscapeUnicode

1.16.0 · source§

impl Display for ToLowercase

1.16.0 · source§

impl Display for ToUppercase

1.59.0 · source§

impl Display for TryFromCharError

1.69.0 · source§

impl Display for FromBytesUntilNulError

1.17.0 · source§

impl Display for FromBytesWithNulError

source§

impl Display for Ipv4Addr

source§

impl Display for Ipv6Addr

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

1.4.0 · source§

impl Display for AddrParseError

source§

impl Display for SocketAddrV4

source§

impl Display for SocketAddrV6

1.26.0 · source§

impl Display for Location<'_>

1.26.0 · source§

impl Display for PanicInfo<'_>

1.66.0 · source§

impl Display for TryFromFloatSecsError

source§

impl Display for ExpandError

1.29.0 · source§

impl Display for proc_macro::Group

Prints the group as a string that should be losslessly convertible back into the same group (modulo spans), except for possibly TokenTree::Groups with Delimiter::None delimiters.

1.29.0 · source§

impl Display for proc_macro::Ident

Prints the identifier as a string that should be losslessly convertible back into the same identifier.

1.44.0 · source§

impl Display for proc_macro::LexError

1.29.0 · source§

impl Display for proc_macro::Literal

Prints the literal as a string that should be losslessly convertible back into the same literal (except for possible rounding for floating point literals).

1.29.0 · source§

impl Display for proc_macro::Punct

Prints the punctuation character as a string that should be losslessly convertible back into the same character.

1.15.0 · source§

impl Display for proc_macro::TokenStream

Prints the token stream as a string that is supposed to be losslessly convertible back into the same token stream (modulo spans), except for possibly TokenTree::Groups with Delimiter::None delimiters and negative numeric literals.

Note: the exact form of the output is subject to change, e.g. there might be changes in the whitespace used between tokens. Therefore, you should not do any kind of simple substring matching on the output string (as produced by to_string) to implement a proc macro, because that matching might stop working if such changes happen. Instead, you should work at the TokenTree level, e.g. matching against TokenTree::Ident, TokenTree::Punct, or TokenTree::Literal.

1.65.0 · source§

impl Display for Backtrace

source§

impl Display for JoinPathsError

1.56.0 · source§

impl Display for WriterPanicked

source§

impl Display for std::io::error::Error

source§

impl Display for Display<'_>

1.7.0 · source§

impl Display for StripPrefixError

source§

impl Display for ExitStatus

source§

impl Display for ExitStatusError

1.26.0 · source§

impl Display for AccessError

1.8.0 · source§

impl Display for SystemTimeError

source§

impl Display for anyhow::Error

source§

impl Display for getrandom::error::Error

source§

impl Display for BigInt

source§

impl Display for BigUint

source§

impl Display for ParseBigIntError

source§

impl Display for num_traits::ParseFloatError

source§

impl Display for proc_macro2::Group

Prints the group as a string that should be losslessly convertible back into the same group (modulo spans), except for possibly TokenTree::Groups with Delimiter::None delimiters.

source§

impl Display for proc_macro2::Ident

Prints the identifier as a string that should be losslessly convertible back into the same identifier.

source§

impl Display for proc_macro2::LexError

source§

impl Display for proc_macro2::Literal

source§

impl Display for proc_macro2::Punct

Prints the punctuation character as a string that should be losslessly convertible back into the same character.

source§

impl Display for proc_macro2::TokenStream

Prints the token stream as a string that is supposed to be losslessly convertible back into the same token stream (modulo spans), except for possibly TokenTree::Groups with Delimiter::None delimiters and negative numeric literals.

source§

impl Display for semver::parse::Error

source§

impl Display for BuildMetadata

source§

impl Display for Comparator

source§

impl Display for Prerelease

source§

impl Display for Version

source§

impl Display for VersionReq

source§

impl Display for serde::de::value::Error

source§

impl Display for syn::error::Error

source§

impl Display for Lifetime

source§

impl Display for LitFloat

source§

impl Display for LitInt

source§

impl Display for uuid::error::Error

source§

impl Display for Braced

source§

impl Display for Hyphenated

source§

impl Display for Simple

source§

impl Display for Urn

source§

impl Display for Uuid

source§

impl Display for getrandom::error::Error

source§

impl Display for ReadError

source§

impl Display for rand_core::error::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.

§

impl Display for BinaryReaderError

§

impl Display for BinaryReaderError

§

impl Display for BuildError

§

impl Display for BuildError

§

impl Display for CaseFoldError

§

impl Display for CollectionAllocErr

§

impl Display for ColoredString

§

impl Display for DeserializeError

§

impl Display for Digest

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for Error

§

impl Display for ErrorKind

§

impl Display for ErrorKind

§

impl Display for F32

§

impl Display for F64

§

impl Display for FuncError

§

impl Display for FuncType

§

impl Display for GlobalError

§

impl Display for GroupInfoError

§

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.

§

impl Display for InstantiationError

§

impl Display for InvalidBufferSize

§

impl Display for InvalidLength

§

impl Display for InvalidOutputSize

§

impl Display for InvalidOutputSize

§

impl Display for InvalidParityValue

§

impl Display for KebabName

§

impl Display for KebabStr

§

impl Display for KebabString

§

impl Display for LinkerError

§

impl Display for MacError

§

impl Display for MatchError

§

impl Display for MemoryError

§

impl Display for Message

§

impl Display for ModuleError

§

impl Display for ModuleInfoError

§

impl Display for OutOfRangeError

§

impl Display for ParseIntError

§

impl Display for PatternIDError

§

impl Display for PatternSetInsertError

§

impl Display for PredicateError

§

impl Display for PrimitiveValType

§

impl Display for PublicKey

§

impl Display for RecvError

§

impl Display for RecvTimeoutError

§

impl Display for RefType

§

impl Display for Regex

§

impl Display for Regex

§

impl Display for SelectTimeoutError

§

impl Display for SerializeError

§

impl Display for SerializedSignature

§

impl Display for Signature

§

impl Display for Signature

§

impl Display for Signature

§

impl Display for SmallIndexError

§

impl Display for StateIDError

§

impl Display for TableError

§

impl Display for TransactionHashBech32EncodeError

§

impl Display for Trap

§

impl Display for TrapCode

§

impl Display for TryFromIntError

§

impl Display for TryFromValueError

§

impl Display for TryRecvError

§

impl Display for TrySelectError

§

impl Display for UnicodeWordBoundaryError

§

impl Display for UnicodeWordError

§

impl Display for UntypedError

§

impl Display for ValType

§

impl Display for Value

§

impl Display for ValueType

§

impl Display for XOnlyPublicKey

source§

impl<'a> Display for Unexpected<'a>

1.60.0 · source§

impl<'a> Display for EscapeAscii<'a>

1.34.0 · source§

impl<'a> Display for radix_engine::types::radix_engine_common::prelude::rust::str::EscapeDebug<'a>

1.34.0 · source§

impl<'a> Display for radix_engine::types::radix_engine_common::prelude::rust::str::EscapeDefault<'a>

1.34.0 · source§

impl<'a> Display for radix_engine::types::radix_engine_common::prelude::rust::str::EscapeUnicode<'a>

source§

impl<'a> Display for ParseBuffer<'a>

§

impl<'a> Display for DisplayableManifestValueKind<'a>

source§

impl<'a> Display for dyn Expected + 'a

§

impl<'a, 'b, TValue, TContext> Display for ContextDisplayable<'a, TValue, TContext>
where TValue: ContextualDisplay<TContext> + ?Sized,

source§

impl<'a, K, V> Display for radix_engine::types::radix_engine_common::prelude::hash_map::OccupiedError<'a, K, V>
where K: Debug, V: Debug,

source§

impl<'a, K, V, A> Display for radix_engine::types::radix_engine_common::prelude::btree_map::OccupiedError<'a, K, V, A>
where K: Debug + Ord, V: Debug, A: Allocator + Clone,

§

impl<'a, K, V, S, A> Display for OccupiedError<'a, K, V, S, A>
where K: Debug, V: Debug, A: Allocator + Clone,

§

impl<'a, K, V, S, A> Display for OccupiedError<'a, K, V, S, A>
where K: Debug, V: Debug, A: Allocator + Clone,

§

impl<'a, R, G, T> Display for MappedReentrantMutexGuard<'a, R, G, T>
where R: RawMutex + 'a, G: GetThreadId + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, G, T> Display for ReentrantMutexGuard<'a, R, G, T>
where R: RawMutex + 'a, G: GetThreadId + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for MappedMutexGuard<'a, R, T>
where R: RawMutex + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for MappedRwLockReadGuard<'a, R, T>
where R: RawRwLock + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for MappedRwLockWriteGuard<'a, R, T>
where R: RawRwLock + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for MutexGuard<'a, R, T>
where R: RawMutex + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for RwLockReadGuard<'a, R, T>
where R: RawRwLock + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for RwLockUpgradableReadGuard<'a, R, T>
where R: RawRwLockUpgrade + 'a, T: Display + 'a + ?Sized,

§

impl<'a, R, T> Display for RwLockWriteGuard<'a, R, T>
where R: RawRwLock + 'a, T: Display + 'a + ?Sized,

§

impl<'a, T> Display for MutexGuard<'a, T>
where T: Display + ?Sized,

§

impl<'a, T> Display for SpinMutexGuard<'a, T>
where T: Display + ?Sized,

§

impl<'rwlock, T> Display for RwLockReadGuard<'rwlock, T>
where T: Display + ?Sized,

§

impl<'rwlock, T, R> Display for RwLockUpgradableGuard<'rwlock, T, R>
where T: Display + ?Sized,

§

impl<'rwlock, T, R> Display for RwLockWriteGuard<'rwlock, T, R>
where T: Display + ?Sized,

source§

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

source§

impl<E> Display for PayloadValidationError<E>
where E: CustomExtension,

source§

impl<E> Display for TypedTraversalError<E>
where E: CustomExtension,

source§

impl<E> Display for Report<E>
where E: Error,

source§

impl<F> Display for FormatterFn<F>
where F: Fn(&mut Formatter<'_>) -> Result<(), Error>,

1.33.0 · source§

impl<Ptr> Display for Pin<Ptr>
where Ptr: Display,

source§

impl<T> Display for TryLockError<T>

source§

impl<T> Display for radix_engine::types::radix_engine_common::prelude::rust::sync::mpsc::TrySendError<T>

source§

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

source§

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

1.20.0 · source§

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

1.20.0 · source§

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

source§

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

1.74.0 · source§

impl<T> Display for Saturating<T>
where T: Display,

1.10.0 · source§

impl<T> Display for Wrapping<T>
where T: Display,

source§

impl<T> Display for radix_engine::types::radix_engine_common::prelude::rust::sync::mpsc::SendError<T>

1.20.0 · source§

impl<T> Display for radix_engine::types::radix_engine_common::prelude::rust::sync::MutexGuard<'_, T>
where T: Display + ?Sized,

source§

impl<T> Display for PoisonError<T>

1.20.0 · source§

impl<T> Display for radix_engine::types::radix_engine_common::prelude::rust::sync::RwLockReadGuard<'_, T>
where T: Display + ?Sized,

1.20.0 · source§

impl<T> Display for radix_engine::types::radix_engine_common::prelude::rust::sync::RwLockWriteGuard<'_, T>
where T: Display + ?Sized,

source§

impl<T> Display for TryFromBigIntError<T>

§

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

§

impl<T> Display for SendError<T>

§

impl<T> Display for SendTimeoutError<T>

§

impl<T> Display for ShardedLockReadGuard<'_, T>
where T: Display + ?Sized,

§

impl<T> Display for ShardedLockWriteGuard<'_, T>
where T: Display + ?Sized,

§

impl<T> Display for TrySendError<T>

source§

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

source§

impl<T, A> Display for Rc<T, A>
where T: Display + ?Sized, A: Allocator,

source§

impl<T, A> Display for radix_engine::types::radix_engine_common::prelude::rust::sync::Arc<T, A>
where T: Display + ?Sized, A: Allocator,

source§

impl<W> Display for IntoInnerError<W>

source§

impl<X> Display for ValueKind<X>
where X: CustomValueKind,

source§

impl<const N: usize> Display for GetManyMutError<N>

§

impl<const N: usize> Display for BInt<N>

§

impl<const N: usize> Display for BIntD8<N>

§

impl<const N: usize> Display for BIntD16<N>

§

impl<const N: usize> Display for BIntD32<N>

§

impl<const N: usize> Display for BUint<N>

§

impl<const N: usize> Display for BUintD8<N>

§

impl<const N: usize> Display for BUintD16<N>

§

impl<const N: usize> Display for BUintD32<N>