has-some-field
Check whether a struct has any field that is_some().
Usage
Use the HasSomeField derive macro on a struct with optional fields.
has_some_field()- Returns whether any of the fields is_some().some_field_count()- Returns the number of optional fields that is_some().
Example
let test_struct = TestStruct ;
assert_eq!;
let test_struct = TestStruct ;
assert!;
let test_struct = TestStruct ;
assert!;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any Contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.