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>>,
}Expand description
Feature Objects
Fields
bbox: Option<Bbox>Bounding Box
geometry: Option<Geometry>Geometry
id: Option<Id>Identifier
properties: Option<Map<String, JsonValue>>Properties
foreign_members: Option<Map<String, JsonValue>>Foreign Members
Implementations
sourceimpl Feature
impl Feature
pub fn from_json_object(object: Map<String, JsonValue>) -> Result<Self, Error>
pub fn from_json_value(value: JsonValue) -> Result<Self, Error>
sourcepub fn property(&self, key: impl AsRef<str>) -> Option<&JsonValue>
pub fn property(&self, key: impl AsRef<str>) -> Option<&JsonValue>
Return the value of this property, if it’s set
sourcepub fn contains_property(&self, key: impl AsRef<str>) -> bool
pub fn contains_property(&self, key: impl AsRef<str>) -> bool
Return true iff this key is set
sourcepub fn set_property(
&mut self,
key: impl Into<String>,
value: impl Into<JsonValue>
)
pub fn set_property(
&mut self,
key: impl Into<String>,
value: impl Into<JsonValue>
)
Set a property to this value, overwriting any possible older value
sourcepub fn remove_property(&mut self, key: impl AsRef<str>) -> Option<JsonValue>
pub fn remove_property(&mut self, key: impl AsRef<str>) -> Option<JsonValue>
Removes a key from the properties map, returning the value at the key if the key
was previously in the properties map.
sourcepub fn len_properties(&self) -> usize
pub fn len_properties(&self) -> usize
The number of properties
sourcepub fn properties_iter(
&self
) -> Box<dyn ExactSizeIterator<Item = (&String, &JsonValue)>>
pub fn properties_iter(
&self
) -> Box<dyn ExactSizeIterator<Item = (&String, &JsonValue)>>
Returns an iterator over all the properties
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Feature
impl<'de> Deserialize<'de> for Feature
sourcefn deserialize<D>(deserializer: D) -> Result<Feature, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Feature, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl FromIterator<Feature> for FeatureCollection
impl FromIterator<Feature> for FeatureCollection
Create a FeatureCollection using the collect
method on an iterator of Features. If every item
contains a bounding-box of the same dimension, then the
output has a bounding-box of the union of them.
Otherwise, the output will not have a bounding-box.
sourcefn from_iter<T: IntoIterator<Item = Feature>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Feature>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl<T> TryFrom<Feature> for Geometry<T> where
T: CoordFloat,
This is supported on crate feature geo-types only.
impl<T> TryFrom<Feature> for Geometry<T> where
T: CoordFloat,
geo-types only.impl StructuralPartialEq for Feature
Auto Trait Implementations
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
