pub trait StyleLayerType:
Sized
+ Send
+ Sync
+ 'static {
type LayoutProperties: LayoutSet;
type PaintProperties: PaintSet;
type Extra: Clone + Default + Send + Sync + 'static;
const INFO: LayerTypeInfo;
const PROPERTIES: &'static PropertyTable;
// Required method
fn visit_property<V>(
slot: usize,
visitor: V,
) -> Option<<V as PropertyVisitor<LayerStyle<Self>>>::Output>
where V: PropertyVisitor<LayerStyle<Self>>;
// Provided methods
fn populate_font_stack(
_style: &LayerStyle<Self>,
_out: &mut VecSet<Vec<String>>,
) { ... }
fn has_section_overrides(_style: &LayerStyle<Self>) -> bool { ... }
fn paint_lays_out(_a: &LayerStyle<Self>, _b: &LayerStyle<Self>) -> bool { ... }
fn paint_layout_global_state_refs(
_style: &LayerStyle<Self>,
) -> Option<&VecSet<String>> { ... }
fn paint_layout_host_function_refs(
_style: &LayerStyle<Self>,
) -> Option<&VecSet<String>> { ... }
fn content_elevation(
_style: &LayerStyle<Self>,
) -> Option<&PropertyValue<f32>> { ... }
fn layer_blend(
_paint: &<Self::PaintProperties as PaintSet>::Evaluated,
) -> LayerBlendType { ... }
}Expand description
A layer type: what its layers hold and how they differ.
Required Associated Constants§
const INFO: LayerTypeInfo
Sourceconst PROPERTIES: &'static PropertyTable
const PROPERTIES: &'static PropertyTable
The type’s property table: PROPERTIES in
<type>_layer_properties.rs for the spec’s types, which
//tools/style-codegen writes, and the one
layer_properties! declares for another
crate’s.
Required Associated Types§
Required Methods§
Sourcefn visit_property<V>(
slot: usize,
visitor: V,
) -> Option<<V as PropertyVisitor<LayerStyle<Self>>>::Output>where
V: PropertyVisitor<LayerStyle<Self>>,
fn visit_property<V>(
slot: usize,
visitor: V,
) -> Option<<V as PropertyVisitor<LayerStyle<Self>>>::Output>where
V: PropertyVisitor<LayerStyle<Self>>,
Calls visitor with the field of the property in slot of
PROPERTIES.
Provided Methods§
fn populate_font_stack( _style: &LayerStyle<Self>, _out: &mut VecSet<Vec<String>>, )
Sourcefn has_section_overrides(_style: &LayerStyle<Self>) -> bool
fn has_section_overrides(_style: &LayerStyle<Self>) -> bool
Whether a section of a formatted value of style overrides the
overridable paint properties.
Sourcefn paint_lays_out(_a: &LayerStyle<Self>, _b: &LayerStyle<Self>) -> bool
fn paint_lays_out(_a: &LayerStyle<Self>, _b: &LayerStyle<Self>) -> bool
Whether going from a to b changes a paint property that the
type’s buckets are laid out with, besides the data-driven values
that the property table says they are.
Sourcefn paint_layout_global_state_refs(
_style: &LayerStyle<Self>,
) -> Option<&VecSet<String>>
fn paint_layout_global_state_refs( _style: &LayerStyle<Self>, ) -> Option<&VecSet<String>>
The global-state keys of the paint properties that the type’s buckets
are laid out with, as paint_lays_out counts
them: a change of one of their values lays the layer out again.
Sourcefn paint_layout_host_function_refs(
_style: &LayerStyle<Self>,
) -> Option<&VecSet<String>>
fn paint_layout_host_function_refs( _style: &LayerStyle<Self>, ) -> Option<&VecSet<String>>
The host-dependent function names of the paint properties that the
type’s buckets are laid out with, as paint_lays_out
counts them: invalidating one of them lays the layer out again.
Sourcefn content_elevation(_style: &LayerStyle<Self>) -> Option<&PropertyValue<f32>>
fn content_elevation(_style: &LayerStyle<Self>) -> Option<&PropertyValue<f32>>
The layout property that raises the layer’s content above the ground, if the type has one.
Sourcefn layer_blend(
_paint: &<Self::PaintProperties as PaintSet>::Evaluated,
) -> LayerBlendType
fn layer_blend( _paint: &<Self::PaintProperties as PaintSet>::Evaluated, ) -> LayerBlendType
How a layer of the type with the paint values paint composites
onto what is drawn beneath it: its *-layer-blend, or normal for a
type without one.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".