pub struct EvaluationContext {
pub zoom: Option<f64>,
pub feature: Feature,
pub global_state: BTreeMap<String, Value>,
pub available_images: Vec<String>,
pub canonical: Option<(u32, u32, u32)>,
pub heatmap_density: Option<f64>,
pub elevation: Option<f64>,
pub line_progress: Option<f64>,
}Expand description
Everything an expression can read while evaluating: global parameters such
as zoom, the current Feature, and the shared global-state map read by
the global-state operator.
Fields§
§zoom: Option<f64>§feature: Feature§global_state: BTreeMap<String, Value>§available_images: Vec<String>Image names known to be available (used by the image operator).
canonical: Option<(u32, u32, u32)>The canonical tile (z, x, y) the feature belongs to, if any.
heatmap_density: Option<f64>Heatmap density (heatmap-density), 0..1.
elevation: Option<f64>Terrain elevation (elevation).
line_progress: Option<f64>Line progress along a symbol/line (line-progress), 0..1.
Implementations§
Source§impl EvaluationContext
impl EvaluationContext
pub fn new() -> EvaluationContext
pub fn with_zoom(self, zoom: f64) -> EvaluationContext
pub fn with_feature(self, feature: Feature) -> EvaluationContext
pub fn with_global_state( self, state: BTreeMap<String, Value>, ) -> EvaluationContext
Trait Implementations§
Source§impl Clone for EvaluationContext
impl Clone for EvaluationContext
Source§fn clone(&self) -> EvaluationContext
fn clone(&self) -> EvaluationContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EvaluationContext
impl Debug for EvaluationContext
Source§impl Default for EvaluationContext
impl Default for EvaluationContext
Source§fn default() -> EvaluationContext
fn default() -> EvaluationContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EvaluationContext
impl RefUnwindSafe for EvaluationContext
impl Send for EvaluationContext
impl Sync for EvaluationContext
impl Unpin for EvaluationContext
impl UnsafeUnpin for EvaluationContext
impl UnwindSafe for EvaluationContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more