Trait grafix_toolbox::uses::Debug 1.0.0[−][src]
Expand description
? formatting.
Debug should format the output in a programmer-facing, debugging context.
Generally speaking, you should just derive a Debug implementation.
When used with the alternate format specifier #?, the output is pretty-printed.
For more information on formatters, see the module-level documentation.
This trait can be used with #[derive] if all fields implement Debug. When
derived for structs, it will use the name of the struct, then {, then a
comma-separated list of each field’s name and Debug value, then }. For
enums, it will use the name of the variant and, if applicable, (, then the
Debug values of the fields, then ).
Stability
Derived Debug formats are not stable, and so may change with future Rust
versions. Additionally, Debug implementations of types provided by the
standard library (libstd, libcore, liballoc, etc.) are not stable, and
may also change with future Rust versions.
Examples
Deriving an implementation:
#[derive(Debug)] struct Point { x: i32, y: i32, } let origin = Point { x: 0, y: 0 }; assert_eq!(format!("The origin is: {:?}", origin), "The origin is: Point { x: 0, y: 0 }");
Manually implementing:
use std::fmt; struct Point { x: i32, y: i32, } impl fmt::Debug for Point { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Point") .field("x", &self.x) .field("y", &self.y) .finish() } } let origin = Point { x: 0, y: 0 }; assert_eq!(format!("The origin is: {:?}", origin), "The origin is: Point { x: 0, y: 0 }");
There are a number of helper methods on the Formatter struct to help you with manual
implementations, such as debug_struct.
Debug implementations using either derive or the debug builder API
on Formatter support pretty-printing using the alternate flag: {:#?}.
Pretty-printing with #?:
#[derive(Debug)] struct Point { x: i32, y: i32, } let origin = Point { x: 0, y: 0 }; assert_eq!(format!("The origin is: {:#?}", origin), "The origin is: Point { x: 0, y: 0, }");
Required methods
Formats the value using the given formatter.
Examples
use std::fmt; struct Position { longitude: f32, latitude: f32, } impl fmt::Debug for Position { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("") .field(&self.longitude) .field(&self.latitude) .finish() } } let position = Position { longitude: 1.987, latitude: 2.983 }; assert_eq!(format!("{:?}", position), "(1.987, 2.983)"); assert_eq!(format!("{:#?}", position), "( 1.987, 2.983, )");
Implementations on Foreign Types
1.16.0[src]impl<'_, T, S> Debug for Intersection<'_, T, S> where
S: BuildHasher,
T: Debug + Eq + Hash,
impl<'_, T, S> Debug for Intersection<'_, T, S> where
S: BuildHasher,
T: Debug + Eq + Hash, 1.16.0[src]impl<'_, T, S> Debug for Difference<'_, T, S> where
S: BuildHasher,
T: Debug + Eq + Hash,
impl<'_, T, S> Debug for Difference<'_, T, S> where
S: BuildHasher,
T: Debug + Eq + Hash, 1.16.0[src]impl<'_, T, S> Debug for SymmetricDifference<'_, T, S> where
S: BuildHasher,
T: Debug + Eq + Hash,
impl<'_, T, S> Debug for SymmetricDifference<'_, T, S> where
S: BuildHasher,
T: Debug + Eq + Hash, impl<R, Rsdr> Debug for ReseedingRng<R, Rsdr> where
R: Debug + BlockRngCore + SeedableRng,
Rsdr: Debug + RngCore,
impl<R, Rsdr> Debug for ReseedingRng<R, Rsdr> where
R: Debug + BlockRngCore + SeedableRng,
Rsdr: Debug + RngCore, impl<X> Debug for WeightedIndex<X> where
X: Debug + SampleUniform + PartialOrd<X>,
<X as SampleUniform>::Sampler: Debug,
impl<X> Debug for WeightedIndex<X> where
X: Debug + SampleUniform + PartialOrd<X>,
<X as SampleUniform>::Sampler: Debug, impl Debug for Rasterizer
impl Debug for Rasterizerlet rasterizer = ab_glyph_rasterizer::Rasterizer::new(3, 4); assert_eq!(&format!("{:?}", rasterizer), "Rasterizer { width: 3, height: 4 }");
impl<'_, T, S, A> Debug for Difference<'_, T, S, A> where
S: BuildHasher,
T: Debug + Eq + Hash,
A: Allocator + Clone,
impl<'_, T, S, A> Debug for Difference<'_, T, S, A> where
S: BuildHasher,
T: Debug + Eq + Hash,
A: Allocator + Clone, impl<'_, T, S, A> Debug for SymmetricDifference<'_, T, S, A> where
S: BuildHasher,
T: Debug + Eq + Hash,
A: Allocator + Clone,
impl<'_, T, S, A> Debug for SymmetricDifference<'_, T, S, A> where
S: BuildHasher,
T: Debug + Eq + Hash,
A: Allocator + Clone, impl<'_, K, V, S, A> Debug for VacantEntry<'_, K, V, S, A> where
A: Allocator + Clone,
K: Debug,
impl<'_, K, V, S, A> Debug for VacantEntry<'_, K, V, S, A> where
A: Allocator + Clone,
K: Debug, impl<'_, T, S, A> Debug for Intersection<'_, T, S, A> where
S: BuildHasher,
T: Debug + Eq + Hash,
A: Allocator + Clone,
impl<'_, T, S, A> Debug for Intersection<'_, T, S, A> where
S: BuildHasher,
T: Debug + Eq + Hash,
A: Allocator + Clone, impl<T, S> Debug for AHashSet<T, S> where
S: BuildHasher,
T: Debug,
impl<T, S> Debug for AHashSet<T, S> where
S: BuildHasher,
T: Debug, impl<K, V, S> Debug for AHashMap<K, V, S> where
S: BuildHasher,
V: Debug,
K: Debug,
impl<K, V, S> Debug for AHashMap<K, V, S> where
S: BuildHasher,
V: Debug,
K: Debug, impl<'h, 'n> Debug for FindIter<'h, 'n>
impl<'h, 'n> Debug for FindIter<'h, 'n>impl<'h, 'n> Debug for FindRevIter<'h, 'n>
impl<'h, 'n> Debug for FindRevIter<'h, 'n>impl<'a, T> Debug for Drain<'a, T> where
T: 'a,
impl<'a, T> Debug for Drain<'a, T> where
T: 'a, impl<T> Debug for GivensRotation<T> where
T: Debug + ComplexField,
<T as ComplexField>::RealField: Debug,
impl<T> Debug for GivensRotation<T> where
T: Debug + ComplexField,
<T as ComplexField>::RealField: Debug, impl<T, D> Debug for SymmetricTridiagonal<T, D> where
T: Debug + ComplexField,
D: Debug + DimSub<Const<1_usize>>,
DefaultAllocator: Allocator<T, D, D>,
DefaultAllocator: Allocator<T, <D as DimSub<Const<1_usize>>>::Output, Const<1_usize>>,
impl<T, D> Debug for SymmetricTridiagonal<T, D> where
T: Debug + ComplexField,
D: Debug + DimSub<Const<1_usize>>,
DefaultAllocator: Allocator<T, D, D>,
DefaultAllocator: Allocator<T, <D as DimSub<Const<1_usize>>>::Output, Const<1_usize>>, impl<T, D> Debug for SymmetricEigen<T, D> where
T: Debug + ComplexField,
D: Debug + Dim,
DefaultAllocator: Allocator<T, D, D>,
DefaultAllocator: Allocator<<T as ComplexField>::RealField, D, Const<1_usize>>,
<T as ComplexField>::RealField: Debug,
impl<T, D> Debug for SymmetricEigen<T, D> where
T: Debug + ComplexField,
D: Debug + Dim,
DefaultAllocator: Allocator<T, D, D>,
DefaultAllocator: Allocator<<T as ComplexField>::RealField, D, Const<1_usize>>,
<T as ComplexField>::RealField: Debug, impl<T, R, C> Debug for ColPivQR<T, R, C> where
C: Debug + Dim,
T: Debug + ComplexField,
R: Debug + DimMin<C>,
DefaultAllocator: Allocator<T, R, C>,
DefaultAllocator: Allocator<T, <R as DimMin<C>>::Output, Const<1_usize>>,
DefaultAllocator: Allocator<(usize, usize), <R as DimMin<C>>::Output, Const<1_usize>>,
impl<T, R, C> Debug for ColPivQR<T, R, C> where
C: Debug + Dim,
T: Debug + ComplexField,
R: Debug + DimMin<C>,
DefaultAllocator: Allocator<T, R, C>,
DefaultAllocator: Allocator<T, <R as DimMin<C>>::Output, Const<1_usize>>,
DefaultAllocator: Allocator<(usize, usize), <R as DimMin<C>>::Output, Const<1_usize>>, impl<T, R, C> Debug for Bidiagonal<T, R, C> where
C: Debug + Dim,
T: Debug + ComplexField,
R: Debug + DimMin<C>,
<R as DimMin<C>>::Output: DimSub<Const<1_usize>>,
DefaultAllocator: Allocator<T, R, C>,
DefaultAllocator: Allocator<T, <R as DimMin<C>>::Output, Const<1_usize>>,
DefaultAllocator: Allocator<T, <<R as DimMin<C>>::Output as DimSub<Const<1_usize>>>::Output, Const<1_usize>>,
impl<T, R, C> Debug for Bidiagonal<T, R, C> where
C: Debug + Dim,
T: Debug + ComplexField,
R: Debug + DimMin<C>,
<R as DimMin<C>>::Output: DimSub<Const<1_usize>>,
DefaultAllocator: Allocator<T, R, C>,
DefaultAllocator: Allocator<T, <R as DimMin<C>>::Output, Const<1_usize>>,
DefaultAllocator: Allocator<T, <<R as DimMin<C>>::Output as DimSub<Const<1_usize>>>::Output, Const<1_usize>>, impl<T, R, C> Debug for SVD<T, R, C> where
C: Debug + Dim,
T: Debug + ComplexField,
R: Debug + DimMin<C>,
DefaultAllocator: Allocator<T, <R as DimMin<C>>::Output, C>,
DefaultAllocator: Allocator<T, R, <R as DimMin<C>>::Output>,
DefaultAllocator: Allocator<<T as ComplexField>::RealField, <R as DimMin<C>>::Output, Const<1_usize>>,
<T as ComplexField>::RealField: Debug,
impl<T, R, C> Debug for SVD<T, R, C> where
C: Debug + Dim,
T: Debug + ComplexField,
R: Debug + DimMin<C>,
DefaultAllocator: Allocator<T, <R as DimMin<C>>::Output, C>,
DefaultAllocator: Allocator<T, R, <R as DimMin<C>>::Output>,
DefaultAllocator: Allocator<<T as ComplexField>::RealField, <R as DimMin<C>>::Output, Const<1_usize>>,
<T as ComplexField>::RealField: Debug, impl<T, D> Debug for Hessenberg<T, D> where
T: Debug + ComplexField,
D: Debug + DimSub<Const<1_usize>>,
DefaultAllocator: Allocator<T, D, D>,
DefaultAllocator: Allocator<T, <D as DimSub<Const<1_usize>>>::Output, Const<1_usize>>,
impl<T, D> Debug for Hessenberg<T, D> where
T: Debug + ComplexField,
D: Debug + DimSub<Const<1_usize>>,
DefaultAllocator: Allocator<T, D, D>,
DefaultAllocator: Allocator<T, <D as DimSub<Const<1_usize>>>::Output, Const<1_usize>>, impl<T, C, const D: usize> Debug for Transform<T, C, D> where
C: Debug + TCategory,
T: Debug + RealField,
Const<D>: DimNameAdd<Const<1_usize>>,
DefaultAllocator: Allocator<T, <Const<D> as DimNameAdd<Const<1_usize>>>::Output, <Const<D> as DimNameAdd<Const<1_usize>>>::Output>,
impl<T, C, const D: usize> Debug for Transform<T, C, D> where
C: Debug + TCategory,
T: Debug + RealField,
Const<D>: DimNameAdd<Const<1_usize>>,
DefaultAllocator: Allocator<T, <Const<D> as DimNameAdd<Const<1_usize>>>::Output, <Const<D> as DimNameAdd<Const<1_usize>>>::Output>, impl<'data, 'file, Mach, R> Debug for MachOSectionIterator<'data, 'file, Mach, R> where
R: ReadRef<'data>,
Mach: MachHeader,
impl<'data, 'file, Mach, R> Debug for MachOSectionIterator<'data, 'file, Mach, R> where
R: ReadRef<'data>,
Mach: MachHeader, impl<'data, 'file, Elf> Debug for ElfSymbolIterator<'data, 'file, Elf> where
Elf: FileHeader,
impl<'data, 'file, Elf> Debug for ElfSymbolIterator<'data, 'file, Elf> where
Elf: FileHeader, impl<'data> Debug for SymbolTable<'data>
impl<'data> Debug for SymbolTable<'data>impl Debug for ImageDynamicRelocation64
impl Debug for ImageDynamicRelocation64impl<E> Debug for I32Bytes<E> where
E: Endian,
impl<E> Debug for I32Bytes<E> where
E: Endian, impl Debug for ImageRuntimeFunctionEntry
impl Debug for ImageRuntimeFunctionEntryimpl Debug for ImageAuxSymbolFunctionBeginEnd
impl Debug for ImageAuxSymbolFunctionBeginEndimpl<'data, 'file, Mach, R> Debug for MachOSymbolIterator<'data, 'file, Mach, R> where
R: ReadRef<'data>,
Mach: MachHeader,
impl<'data, 'file, Mach, R> Debug for MachOSymbolIterator<'data, 'file, Mach, R> where
R: ReadRef<'data>,
Mach: MachHeader, impl Debug for ImageResourceDirectoryString
impl Debug for ImageResourceDirectoryStringimpl Debug for ImageLoadConfigCodeIntegrity
impl Debug for ImageLoadConfigCodeIntegrityimpl<'data, 'file> Debug for CoffSymbolTable<'data, 'file>
impl<'data, 'file> Debug for CoffSymbolTable<'data, 'file>impl Debug for ImageArmRuntimeFunctionEntry
impl Debug for ImageArmRuntimeFunctionEntryimpl<'data, 'file> Debug for CoffSymbolIterator<'data, 'file>
impl<'data, 'file> Debug for CoffSymbolIterator<'data, 'file>impl Debug for ImageBoundImportDescriptor
impl Debug for ImageBoundImportDescriptorimpl<'data, 'file, R> Debug for Symbol<'data, 'file, R> where
R: ReadRef<'data>,
impl<'data, 'file, R> Debug for Symbol<'data, 'file, R> where
R: ReadRef<'data>, impl Debug for ImageLoadConfigDirectory64
impl Debug for ImageLoadConfigDirectory64impl<'data, 'file, Elf, R> Debug for ElfDynamicRelocationIterator<'data, 'file, Elf, R> where
R: ReadRef<'data>,
Elf: FileHeader,
impl<'data, 'file, Elf, R> Debug for ElfDynamicRelocationIterator<'data, 'file, Elf, R> where
R: ReadRef<'data>,
Elf: FileHeader, impl<'data> Debug for SectionTable<'data>
impl<'data> Debug for SectionTable<'data>impl Debug for ImageDynamicRelocation32
impl Debug for ImageDynamicRelocation32impl<E> Debug for I16Bytes<E> where
E: Endian,
impl<E> Debug for I16Bytes<E> where
E: Endian, impl Debug for ImageSeparateDebugHeader
impl Debug for ImageSeparateDebugHeaderimpl Debug for ImageLoadConfigDirectory32
impl Debug for ImageLoadConfigDirectory32impl<E> Debug for U64Bytes<E> where
E: Endian,
impl<E> Debug for U64Bytes<E> where
E: Endian, impl<E> Debug for U16Bytes<E> where
E: Endian,
impl<E> Debug for U16Bytes<E> where
E: Endian, impl<'data, 'file, Mach, R> Debug for MachORelocationIterator<'data, 'file, Mach, R> where
R: ReadRef<'data>,
Mach: MachHeader,
impl<'data, 'file, Mach, R> Debug for MachORelocationIterator<'data, 'file, Mach, R> where
R: ReadRef<'data>,
Mach: MachHeader, impl<'data, 'file> Debug for CoffSymbol<'data, 'file>
impl<'data, 'file> Debug for CoffSymbol<'data, 'file>impl<'data> Debug for ObjectMapEntry<'data>
impl<'data> Debug for ObjectMapEntry<'data>impl<'data, 'file, R> Debug for Section<'data, 'file, R> where
R: ReadRef<'data>,
impl<'data, 'file, R> Debug for Section<'data, 'file, R> where
R: ReadRef<'data>, impl Debug for ImagePrologueDynamicRelocationHeader
impl Debug for ImagePrologueDynamicRelocationHeaderimpl Debug for ImageArm64RuntimeFunctionEntry
impl Debug for ImageArm64RuntimeFunctionEntryimpl<'data, 'file, Elf, R> Debug for ElfSectionRelocationIterator<'data, 'file, Elf, R> where
R: ReadRef<'data>,
Elf: FileHeader,
impl<'data, 'file, Elf, R> Debug for ElfSectionRelocationIterator<'data, 'file, Elf, R> where
R: ReadRef<'data>,
Elf: FileHeader, impl Debug for ImageDynamicRelocation64V2
impl Debug for ImageDynamicRelocation64V2impl Debug for ImageArchiveMemberHeader
impl Debug for ImageArchiveMemberHeaderimpl Debug for ImageDelayloadDescriptor
impl Debug for ImageDelayloadDescriptorimpl Debug for ImageResourceDirectoryEntry
impl Debug for ImageResourceDirectoryEntryimpl<'data, 'table> Debug for SymbolIterator<'data, 'table>
impl<'data, 'table> Debug for SymbolIterator<'data, 'table>impl<'data> Debug for StringTable<'data>
impl<'data> Debug for StringTable<'data>impl<'data> Debug for SymbolMapName<'data>
impl<'data> Debug for SymbolMapName<'data>impl<E> Debug for I64Bytes<E> where
E: Endian,
impl<E> Debug for I64Bytes<E> where
E: Endian, impl<'data, 'file, R> Debug for Comdat<'data, 'file, R> where
R: ReadRef<'data>,
impl<'data, 'file, R> Debug for Comdat<'data, 'file, R> where
R: ReadRef<'data>, impl Debug for ImageAlphaRuntimeFunctionEntry
impl Debug for ImageAlphaRuntimeFunctionEntryimpl Debug for ImageEpilogueDynamicRelocationHeader
impl Debug for ImageEpilogueDynamicRelocationHeaderimpl<'data, 'file, R> Debug for Segment<'data, 'file, R> where
R: ReadRef<'data>,
impl<'data, 'file, R> Debug for Segment<'data, 'file, R> where
R: ReadRef<'data>, impl Debug for ImageDynamicRelocationTable
impl Debug for ImageDynamicRelocationTableimpl<'data> Debug for ArchiveMember<'data>
impl<'data> Debug for ArchiveMember<'data>impl<'data, 'file, R> Debug for CoffRelocationIterator<'data, 'file, R> where
R: ReadRef<'data>,
impl<'data, 'file, R> Debug for CoffRelocationIterator<'data, 'file, R> where
R: ReadRef<'data>, impl Debug for ImageDynamicRelocation32V2
impl Debug for ImageDynamicRelocation32V2impl<E> Debug for U32Bytes<E> where
E: Endian,
impl<E> Debug for U32Bytes<E> where
E: Endian, impl<'data> Debug for CompressedData<'data>
impl<'data> Debug for CompressedData<'data>impl Debug for ImageAlpha64RuntimeFunctionEntry
impl Debug for ImageAlpha64RuntimeFunctionEntryimpl Debug for NoDynamicRelocationIterator
impl Debug for NoDynamicRelocationIteratorImplementors
impl<'_, T, P> Debug for grafix_toolbox::uses::slice::RSplit<'_, T, P> where
T: Debug,
P: FnMut(&T) -> bool, impl<'_, T, P> Debug for grafix_toolbox::uses::slice::RSplitN<'_, T, P> where
T: Debug,
P: FnMut(&T) -> bool, impl<'_, T, P> Debug for grafix_toolbox::uses::slice::Split<'_, T, P> where
T: Debug,
P: FnMut(&T) -> bool, impl<'_, T, P> Debug for grafix_toolbox::uses::slice::SplitN<'_, T, P> where
T: Debug,
P: FnMut(&T) -> bool, impl<'a, R> Debug for ReadExactFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, R> Debug for ReadFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, R> Debug for ReadLineFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, R> Debug for ReadToEndFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, R> Debug for ReadToStringFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, R> Debug for ReadUntilFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, R> Debug for ReadVectoredFuture<'a, R> where
R: Debug + Unpin + ?Sized, impl<'a, S> Debug for SeekFuture<'a, S> where
S: Debug + Unpin + ?Sized, impl<'a, W> Debug for CloseFuture<'a, W> where
W: Debug + Unpin + ?Sized, impl<'a, W> Debug for FlushFuture<'a, W> where
W: Debug + Unpin + ?Sized, impl<'a, W> Debug for WriteAllFuture<'a, W> where
W: Debug + Unpin + ?Sized, impl<'a, W> Debug for WriteFuture<'a, W> where
W: Debug + Unpin + ?Sized, impl<'a, W> Debug for WriteVectoredFuture<'a, W> where
W: Debug + Unpin + ?Sized, impl<'de, I, E> Debug for MapDeserializer<'de, I, E> where
I: Iterator + Debug,
<I as Iterator>::Item: Pair,
<<I as Iterator>::Item as Pair>::Second: Debug, impl<I> Debug for Intersperse<I> where
I: Debug + Iterator,
<I as Iterator>::Item: Clone,
<I as Iterator>::Item: Debug, impl<I, G> Debug for IntersperseWith<I, G> where
G: Debug,
I: Iterator + Debug,
<I as Iterator>::Item: Debug, impl<I, St, F> Debug for grafix_toolbox::uses::iter::Scan<I, St, F> where
I: Debug,
St: Debug, impl<I, U> Debug for grafix_toolbox::uses::iter::Flatten<I> where
I: Debug + Iterator,
U: Debug + Iterator,
<I as Iterator>::Item: IntoIterator,
<<I as Iterator>::Item as IntoIterator>::IntoIter == U,
<<I as Iterator>::Item as IntoIterator>::Item == <U as Iterator>::Item, impl<I, U, F> Debug for grafix_toolbox::uses::iter::FlatMap<I, U, F> where
I: Debug,
U: IntoIterator,
<U as IntoIterator>::IntoIter: Debug, impl<K, V, S, A> Debug for grafix_toolbox::uses::HashMap<K, V, S, A> where
A: Allocator + Clone,
V: Debug,
K: Debug, impl<T> Debug for AssertAsync<T> where
T: Debug, impl<T, S, A> Debug for grafix_toolbox::uses::HashSet<T, S, A> where
S: BuildHasher,
T: Eq + Hash + Debug,
A: Allocator + Clone, impl<W> Debug for grafix_toolbox::uses::asyn::io::BufWriter<W> where
W: AsyncWrite + Debug, impl<X> Debug for Uniform<X> where
X: Debug + SampleUniform,
<X as SampleUniform>::Sampler: Debug,