Expand description
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.
Traits§
- Claim
- Trait for the ability to cheaply duplicate an object.
Derive Macros§
- Claim
- Derive macro generating an impl of the trait
Claim.