Trait otter_api_tests::Display 1.0.0[−][src]
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
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
Write an Ipv6Addr, conforming to the canonical style described by RFC 5952.
impl Display for OpenSSHKeyError
impl Display for OpenSSHKeyErrorimpl Display for Hir
impl Display for HirPrint 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 Ast
impl Display for AstPrint 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<R, Offset> Display for LineInstruction<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> Display for LineInstruction<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, impl<'a> Display for DecodeStringError<'a>
impl<'a> Display for DecodeStringError<'a>impl<'a> Display for PercentEncode<'a>
impl<'a> Display for PercentEncode<'a>Formats the status code, including the canonical reason.
Example
assert_eq!(format!("{}", StatusCode::OK), "200 OK");
impl<T> Display for SendTimeoutError<T>
impl<T> Display for SendTimeoutError<T>impl Display for LengthDelimitedCodecError
impl Display for LengthDelimitedCodecErrorimpl Display for AnyDelimiterCodecError
impl Display for AnyDelimiterCodecErrorimpl<A> Display for Tendril<UTF8, A> where
A: Atomicity,
impl<A> Display for Tendril<UTF8, A> where
A: Atomicity, impl<'a> Display for BufReadDecoderError<'a>
impl<'a> Display for BufReadDecoderError<'a>impl<Static> Display for Atom<Static> where
Static: StaticAtomSet,
impl<Static> Display for Atom<Static> where
Static: StaticAtomSet, impl<'a> Display for CowRcStr<'a>
impl<'a> Display for CowRcStr<'a>Implementors
impl Display for FlexiLoggerErrorimpl Display for otter_api_tests::imports::base64::DecodeErrorimpl Display for LogicErrorimpl Display for RangeImpossibleimpl Display for CompressionMethodimpl Display for PosCFromIteratorErrorimpl Display for InvalidOutputSizeimpl Display for ClearEnvErrorimpl Display for NetlinkAddrimpl Display for FloatIsNanimpl Display for UnixSocketAddrimpl Display for CoordinateOverflowimpl Display for otter_api_tests::zcoord::ParseErrorimpl Display for TotallyUnboundedRangeimpl Display for InvalidPasswordimpl<'_, B> Display for Cow<'_, B> where
B: Display + ToOwned + ?Sized,
<B as ToOwned>::Owned: Display, impl<'a> Display for Base64Display<'a>impl<'a, I, B> Display for DelayedFormat<I> where
B: Borrow<Item<'a>>,
I: Iterator<Item = B> + Clone, impl<'a, I, F> Display for FormatWith<'a, I, F> where
F: FnMut(<I as Iterator>::Item, &mut dyn FnMut(&dyn Display)) -> Result<(), Error>,
I: Iterator, impl<'a, K, V> Display for otter_api_tests::btree_map::OccupiedError<'a, K, V> where
K: Debug + Ord,
V: Debug, impl<'a, K, V> Display for otter_api_tests::hash_map::OccupiedError<'a, K, V> where
K: Debug,
V: Debug, impl<'a, R, G, T> Display for MappedReentrantMutexGuard<'a, R, G, T> where
T: 'a + Display + ?Sized,
G: 'a + GetThreadId,
R: 'a + RawMutex, impl<'a, R, G, T> Display for ReentrantMutexGuard<'a, R, G, T> where
T: 'a + Display + ?Sized,
G: 'a + GetThreadId,
R: 'a + RawMutex, impl<'a, R, T> Display for otter_api_tests::imports::parking_lot::lock_api::MappedMutexGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawMutex, impl<'a, R, T> Display for MappedRwLockReadGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawRwLock, impl<'a, R, T> Display for MappedRwLockWriteGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawRwLock, impl<'a, R, T> Display for otter_api_tests::imports::parking_lot::lock_api::MutexGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawMutex, impl<'a, R, T> Display for otter_api_tests::imports::parking_lot::lock_api::RwLockReadGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawRwLock, impl<'a, R, T> Display for RwLockUpgradableReadGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawRwLockUpgrade, impl<'a, R, T> Display for otter_api_tests::imports::parking_lot::lock_api::RwLockWriteGuard<'a, R, T> where
T: 'a + Display + ?Sized,
R: 'a + RawRwLock, impl<'a, T> Display for StyledValue<'a, T> where
T: Display, impl<E> Display for ParseNotNanError<E> where
E: Display, impl<T> Display for SyncFailure<T> where
T: Display, impl<T> Display for OrderedFloat<T> where
T: Float + Display,