Crates.io | splat_derive |
lib.rs | splat_derive |
version | 0.1.1 |
source | src |
created_at | 2024-01-14 12:00:11.870963 |
updated_at | 2024-01-14 23:56:27.063933 |
description | A crate providing a Splat derive macro, which generates a splat method for the struct deriving it. |
homepage | |
repository | https://github.com/bread42/splat_derive |
max_upload_size | |
id | 1099383 |
size | 7,070 |
This is a crate providing a Splat derive macro, which generates a splat method for the struct deriving it.
splat
methodThe splat
method is commonly defined for structs with numeric fields of the same type. It takes a value v
and returns an instance of the struct where each field is set to v
.
This crate provides a macro that generates a splat
method for any struct that has fields which are all of the same type. However, the type shared by each field must implement Clone.
Add the following to your Cargo.toml
[dependencies]
splat_derive = "0.1.0"