Document how style traits can be derived

This commit is contained in:
Anthony Ramine 2017-08-28 09:37:25 +02:00
parent 41c3be54ea
commit ba4136b5a8
4 changed files with 44 additions and 3 deletions

View file

@ -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;