Struct geojson::Feature[][src]

pub struct Feature {
    pub bbox: Option<Bbox>,
    pub geometry: Option<Geometry>,
    pub id: Option<Id>,
    pub properties: Option<Map<String, JsonValue>>,
    pub foreign_members: Option<Map<String, JsonValue>>,
}

Fields

bbox: Option<Bbox>geometry: Option<Geometry>id: Option<Id>properties: Option<Map<String, JsonValue>>foreign_members: Option<Map<String, JsonValue>>

Implementations

impl Feature[src]

pub fn from_json_object(object: Map<String, JsonValue>) -> Result<Self, Error>[src]

pub fn from_json_value(value: JsonValue) -> Result<Self, Error>[src]

pub fn property(&self, key: impl AsRef<str>) -> Option<&JsonValue>[src]

Return the value of this property, if it's set

pub fn contains_property(&self, key: impl AsRef<str>) -> bool[src]

Return true iff this key is set

pub fn set_property(
    &mut self,
    key: impl Into<String>,
    value: impl Into<JsonValue>
)
[src]

Set a property to this value, overwriting any possible older value

pub fn remove_property(&mut self, key: impl AsRef<str>) -> Option<JsonValue>[src]

Removes a key from the properties map, returning the value at the key if the key was previously in the properties map.

pub fn len_properties(&self) -> usize[src]

The number of properties

pub fn properties_iter(
    &self
) -> Box<dyn ExactSizeIterator<Item = (&String, &JsonValue)>>
[src]

Returns an iterator over all the properties

Trait Implementations

impl Clone for Feature[src]

impl Debug for Feature[src]

impl<'de> Deserialize<'de> for Feature[src]

impl Display for Feature[src]

impl<'a> From<&'a Feature> for Map<String, JsonValue>[src]

impl From<Feature> for GeoJson[src]

impl PartialEq<Feature> for Feature[src]

impl Serialize for Feature[src]

impl StructuralPartialEq for Feature[src]

impl TryFrom<GeoJson> for Feature[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Map<String, Value>> for Feature[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Value> for Feature[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.