mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Document how style traits can be derived
This commit is contained in:
parent
41c3be54ea
commit
ba4136b5a8
4 changed files with 44 additions and 3 deletions
|
@ -199,6 +199,11 @@ impl<'a, 'cx, 'cx_a: 'cx, S: ToComputedValue + 'a> Iterator for ComputedVecIter<
|
|||
}
|
||||
|
||||
/// A trait to represent the conversion between computed and specified values.
|
||||
///
|
||||
/// This trait is derivable with `#[derive(ToComputedValue)]`. The derived
|
||||
/// implementation just calls `ToComputedValue::to_computed_value` on each field
|
||||
/// of the passed value, or `Clone::clone` if the field is annotated with
|
||||
/// `#[compute(clone)]`.
|
||||
pub trait ToComputedValue {
|
||||
/// The computed value type we're going to be converted to.
|
||||
type ComputedValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue