Derive Debug for types where not all fields implement Debug.
This crate works on stable and with no_std
.
On nightly the unstable
feature can be used for specialization based trait detection and/or ..
formatting.
```rust use partialdebug::placeholder::PartialDebug;
struct Dog { legs: usize, eyes: usize, dna: DNA, }
assert_eq!(format!("{:?}", Dog::new()), "Dog { legs: 4, eyes: 2, dna: DNA }"); ```
```rust use partialdebug::placeholder::PartialDebug;
struct Dog { legs: usize, eyes: usize, dna: DNA, }
assert_eq!(format!("{:?}", Dog::new()), "Dog { legs: 4, eyes: 2, dna: Unknown }"); ```
Only available on nightly after setting the unstable
feature.
Requires the debug_non_exhaustive
feature to be enabled in user code.
Only available for structs with named fields.
```rust
use partialdebug::non_exhaustive::PartialDebug;
struct Dog { legs: usize, eyes: usize, dna: DNA, }
assert_eq!(format!("{:?}", Dog::new()), "Dog { legs: 4, eyes: 2, .. }"); ```
Trait detection for generic types requires specialization.
To enable specialization based trait detection use a nightly compiler and enable the unstable
feature.
```rust use partialdebug::placeholder::PartialDebug;
struct Container
assert_eq!(format!("{:?}", Container(42)), "Container(42)");
assert_eq!(format!("{:?}", Container(42)), "Container(T)"); ```
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.