3 releases
| 0.1.2 | Dec 5, 2024 |
|---|---|
| 0.1.1 | Dec 5, 2024 |
| 0.1.0 | Dec 4, 2024 |
| 0.0.0 |
|
#13 in #derived
93 downloads per month
Used in yukon_derive
10KB
126 lines
Provides trait for the ability to cheaply duplicate an object.
Examples
Claim can be derived for structs that contain only fields that implement Claim themselves:
use yukon::Claim;
#[derive(Claim)]
struct Context {
value: Arc<usize>,
}
#
Alternatively, Claim can be implemented manually:
#
#
impl Claim for Context {
fn claim(&self) -> Self {
Self {
value: Arc::clone(&self.value),
}
}
}
#
References
This crate has been inspired by Claiming, auto and otherwise.
yukon
Provides trait for the ability to cheaply duplicate an object.
Dependencies
~70KB