1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2025 the Xilem Authors
// SPDX-License-Identifier: Apache-2.0
use TypeId;
use Default;
use crateWidget;
/// A marker trait that indicates that a type is intended to be used as a widget's [property].
///
/// Properties are arbitrary values that are stored alongside a widget.
///
/// Note that if a type `Foobar` implements `Property`, that tells you that `Foobar` is meant
/// to be a property of *some* widget, but it doesn't tell you *which* widget accepts `Foobar`
/// as a property.
/// That information is deliberately not encoded in the type system.
/// We might change that in a future version.
///
/// [property]: crate::doc::masonry_concepts#properties
/// Marker trait implemented by widgets that read the [property] `P`.
///
/// Every widget can have an arbitrary set of properties whether or not it implements this trait,
/// but widgets will usually only read the value of a small set of properties.
/// Each widget should (though this isn't enforced) implement `UsesProperty` for every property it reads.
///
/// This is not used directly by Masonry, but is instead provided for the convenience of external crates.
///
/// [property]: crate::doc::masonry_concepts#properties