Derive Macro oy::PartialDebug[][src]

#[derive(PartialDebug)]

Implements Debug for a struct replacing all fields that do not implement Debug with a placeholder.

What it does:


struct NoDebug;

#[derive(PartialDebug)]
struct Struct {
    field: NoDebug,
}

Expands to something like:

impl Debug for Struct {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_struct("Struct")
            .field(
                "field",
                match &self.field.try_as_debug() {
                    Ok(field) => field,
                    Err(_) => &oy::specialization::Unknown,
                },
            )
            .finish()
    }
}