Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@twittner
Copy link
Owner

Adds #[cbor(skip_if = "<path>")].

This attribute can be attached to fields in structs and enums and prevents those fields from being encoded if the predicate function denoted by path returns true. This function must satisfy the following signature:

fn pred<T>(_: &T) -> bool {
    todo!()
}

Field types must implement Default, and when decoding, the fields are initialised with Default::default() if no value is present.

Please note that skip_if is mutually exclusive with nil, is_nil, and has_nil.

Addresses #43.

Signed-off-by: Toralf Wittner <[email protected]>
@twittner twittner marked this pull request as ready for review November 19, 2025 18:10
@twittner
Copy link
Owner Author

Merged in aa26577

@twittner twittner closed this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants