mln-rs-style 0.0.21

Part of mln-rs, a MapLibre map renderer written in Rust. Depend on mln-rs instead.
Documentation
// This file is generated by //tools/style-codegen from the style spec
// (tools/style-codegen/v8.json). Do not edit.

use crate::light::Light;
use crate::property::table::{Properties, PropertyInfo, PropertyTable, PropertyVisitor};

/// The properties, by slot.
pub(crate) static PROPERTIES: PropertyTable = PropertyTable::new(
    &[
        PropertyInfo::paint("anchor"),
        PropertyInfo::paint("position"),
        PropertyInfo::paint("color"),
        PropertyInfo::paint("intensity"),
    ],
    &[0, 2, 3, 1],
);

impl Properties for Light {
    const TABLE: &'static PropertyTable = &PROPERTIES;

    fn visit<V: PropertyVisitor<Self>>(slot: usize, visitor: V) -> Option<V::Output> {
        Some(match slot {
            0 => visitor.paint(|s| &s.properties.light_anchor, |s| &mut s.properties.light_anchor),
            1 => visitor.paint(|s| &s.properties.light_position, |s| &mut s.properties.light_position),
            2 => visitor.paint(|s| &s.properties.light_color, |s| &mut s.properties.light_color),
            3 => visitor.paint(|s| &s.properties.light_intensity, |s| &mut s.properties.light_intensity),
            _ => return None,
        })
    }
}