#default #extension #traits #ext #methods

default-ext

This library provides extension methods for the Default trait

1 unstable release

0.1.0 Nov 8, 2020

#2928 in Rust patterns

Download history 30/week @ 2024-07-28 1/week @ 2024-08-04 62/week @ 2024-08-11 39/week @ 2024-08-18 37/week @ 2024-08-25 7/week @ 2024-09-01 35/week @ 2024-09-08 46/week @ 2024-09-15 60/week @ 2024-09-22 40/week @ 2024-09-29 140/week @ 2024-10-06 260/week @ 2024-10-13 57/week @ 2024-10-20 68/week @ 2024-10-27 104/week @ 2024-11-03

517 downloads per month
Used in 2 crates

MIT/Apache

7KB

default-ext

ci Rust Documentation Latest Version

This library provides extension methods for the Default trait.

Example

case1:

use default_ext::DefaultExt;
assert!(false.is_default());

case2:

#[derive(serde::Serialize, serde::Deserialize)]
struct Object {
    #[serde(
        default,
        skip_serializing_if = "default_ext::DefaultExt::is_default",
    )]
    is_test: bool,
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.


lib.rs:

This library provides extension methods for the Default trait.

Example

case1:

assert!(false.is_default());

case2:

#[derive(serde::Serialize, serde::Deserialize)]
struct Object {
   #[serde(
       default,
       skip_serializing_if = "default_ext::DefaultExt::is_default",
   )]
   is_test: bool,
}

No runtime deps