Struct gdal::vector::Feature[][src]

pub struct Feature<'a> { /* fields omitted */ }

OGR Feature

Implementations

impl<'a> Feature<'a>[src]

pub fn new(defn: &'a Defn) -> Result<Feature<'_>>[src]

pub unsafe fn from_c_feature(
    defn: &'a Defn,
    c_feature: OGRFeatureH
) -> Feature<'_>
[src]

Creates a new Feature by wrapping a C pointer and a Defn

Safety

This method operates on a raw C pointer

pub fn _lazy_feature_geometries(defn: &'a Defn) -> Vec<Geometry>[src]

pub fn fid(&self) -> Option<u64>[src]

Returns the feature identifier, or None if none has been assigned.

pub fn field<S: AsRef<str>>(&self, name: S) -> Result<Option<FieldValue>>[src]

Get the value of a named field. If the field exists, it returns a FieldValue wrapper, that you need to unpack to a base type (string, float, etc).

If the field is missing, returns GdalError::InvalidFieldName.

If the field has an unsupported type, returns a GdalError::UnhandledFieldType.

If the field is null, returns None.

pub fn geometry(&self) -> &Geometry[src]

Get the field’s geometry.

pub fn geometry_by_name(&self, field_name: &str) -> Result<&Geometry>[src]

pub fn geometry_by_index(&self, idx: usize) -> Result<&Geometry>[src]

pub fn create(&self, lyr: &Layer<'_>) -> Result<()>[src]

pub fn set_field_string(&self, field_name: &str, value: &str) -> Result<()>[src]

pub fn set_field_double(&self, field_name: &str, value: f64) -> Result<()>[src]

pub fn set_field_integer(&self, field_name: &str, value: i32) -> Result<()>[src]

pub fn set_field_integer64(&self, field_name: &str, value: i64) -> Result<()>[src]

pub fn set_field(&self, field_name: &str, value: &FieldValue) -> Result<()>[src]

pub fn set_geometry(&mut self, geom: Geometry) -> Result<()>[src]

pub fn field_count(&self) -> i32[src]

pub fn fields(&self) -> FieldValueIterator<'_>

Notable traits for FieldValueIterator<'a>

impl<'a> Iterator for FieldValueIterator<'a> type Item = (String, Option<FieldValue>);
[src]

Trait Implementations

impl<'a> Debug for Feature<'a>[src]

impl<'a> Drop for Feature<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Feature<'a>

impl<'a> !Send for Feature<'a>

impl<'a> !Sync for Feature<'a>

impl<'a> Unpin for Feature<'a>

impl<'a> UnwindSafe for Feature<'a>

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.