[][src]Struct mapbox_vector_tile::Feature

pub struct Feature {
    pub geometry: Geometry<i32>,
    pub properties: Rc<Properties>,
}

A single feature. It has a geometry and some properties (i.e. tags)

Fields

geometry: Geometry<i32>

The geomtry

properties: Rc<Properties>

The properties. Uses an Rc because properties can be shared between tiles.

Methods

impl Feature[src]

pub fn new(geometry: Geometry<i32>, properties: Rc<Properties>) -> Self[src]

Create a Feature with this geometry and these properties

pub fn from_geometry(geometry: Geometry<i32>) -> Self[src]

Create a feature (with no propertes) from this geometry.

pub fn get_point<'a>(&'a self) -> Option<Point<i32>>[src]

pub fn translate_geometry(
    &mut self,
    x_func: &dyn Fn(i32) -> i32,
    y_func: &dyn Fn(i32) -> i32
)
[src]

pub fn set<K: Into<Rc<String>>, V: Into<Value>>(self, k: K, v: V) -> Self[src]

Sets a property for this feature. It will panic if the properties are shared with other features. Don't call this if that could happen. Consumes the feature and returns it. Useful for Building pattern

Trait Implementations

impl PartialEq<Feature> for Feature[src]

impl From<Geometry<i32>> for Feature[src]

Convert a geometry to a feature.

impl Clone for Feature[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Feature[src]

Auto Trait Implementations

impl !Send for Feature

impl !Sync for Feature

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]