[][src]Struct mapbox_vector_tile::Layer

pub struct Layer {
    pub name: String,
    pub features: Vec<Feature>,
    pub extent: u32,
}

A Layer in a vector tile

Fields

name: String

The layer's name

features: Vec<Feature>

The features in this layer

extent: u32

The "extent" of this layer. Usualyy 4096 is used.

Methods

impl Layer[src]

pub fn new<S: Into<String>>(name: S) -> Self[src]

Create an empty layer with this name (and 4096 extent)

pub fn new_and_extent(name: String, extent: u32) -> Self[src]

Construct layer with this name and extent

pub fn set_locations(&mut self, geometry_tile: &Tile)[src]

Move all the geometries in this layer so that it's at this geometry_tile.

pub fn add_feature(&mut self, f: Feature)[src]

Add a feature to this layer.

pub fn is_empty(&self) -> bool[src]

True iff this layer has no features

pub fn write_to<W: Write>(self, writer: &mut W)[src]

Encode this layer to the writer.

pub fn to_bytes(self) -> Vec<u8>[src]

Encode this layer into bytes.

Trait Implementations

impl PartialEq<Layer> for Layer[src]

impl From<String> for Layer[src]

impl<'a> From<&'a str> for Layer[src]

impl Clone for Layer[src]

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

Performs copy-assignment from source. Read more

impl Debug for Layer[src]

Auto Trait Implementations

impl !Send for Layer

impl !Sync for Layer

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]