pub struct Feature {
pub id: Option<FeatureId>,
pub geometry: Option<Geometry>,
pub properties: HashMap<String, PropertyValue>,
}Expand description
A feature with geometry and properties
Fields§
§id: Option<FeatureId>Optional feature ID
geometry: Option<Geometry>Geometry (may be None for attribute-only features)
properties: HashMap<String, PropertyValue>Feature properties as key-value pairs
Implementations§
Source§impl Feature
impl Feature
Sourcepub fn with_id(id: FeatureId, geometry: Geometry) -> Self
pub fn with_id(id: FeatureId, geometry: Geometry) -> Self
Creates a new feature with geometry and ID
Sourcepub fn new_attribute_only() -> Self
pub fn new_attribute_only() -> Self
Creates a new feature without geometry (attribute-only)
Sourcepub fn set_property<S: Into<String>>(&mut self, key: S, value: PropertyValue)
pub fn set_property<S: Into<String>>(&mut self, key: S, value: PropertyValue)
Sets a property value
Sourcepub fn get_property(&self, key: &str) -> Option<&PropertyValue>
pub fn get_property(&self, key: &str) -> Option<&PropertyValue>
Gets a property value
Sourcepub fn remove_property(&mut self, key: &str) -> Option<PropertyValue>
pub fn remove_property(&mut self, key: &str) -> Option<PropertyValue>
Removes a property
Sourcepub const fn has_geometry(&self) -> bool
pub const fn has_geometry(&self) -> bool
Returns true if the feature has a geometry
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Feature
impl<'de> Deserialize<'de> for Feature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Feature
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnsafeUnpin for Feature
impl UnwindSafe for Feature
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