Skip to main content

StyleLayerType

Trait StyleLayerType 

Source
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§

Source

const INFO: LayerTypeInfo

Source

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§

Source

type LayoutProperties: LayoutSet

Source

type PaintProperties: PaintSet

Source

type Extra: Clone + Default + Send + Sync + 'static

Data of a layer that isn’t a property.

Required Methods§

Source

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§

Source

fn populate_font_stack( _style: &LayerStyle<Self>, _out: &mut VecSet<Vec<String>>, )

Source

fn has_section_overrides(_style: &LayerStyle<Self>) -> bool

Whether a section of a formatted value of style overrides the overridable paint properties.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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".

Implementors§

Source§

impl StyleLayerType for Background

Source§

impl StyleLayerType for Circle

Source§

impl StyleLayerType for ColorRelief

Source§

impl StyleLayerType for Fill

Source§

impl StyleLayerType for FillExtrusion

Source§

impl StyleLayerType for Heatmap

Source§

impl StyleLayerType for Hillshade

Source§

impl StyleLayerType for Line

Source§

impl StyleLayerType for Raster

Source§

impl StyleLayerType for Symbol