Struct LineStringBuilder

Source
pub struct LineStringBuilder { /* private fields */ }
Expand description

The GeoArrow equivalent to Vec<Option<LineString>>: a mutable collection of LineStrings.

Converting an LineStringBuilder into a LineStringArray is O(1).

Implementations§

Source§

impl LineStringBuilder

Source

pub fn new(typ: LineStringType) -> Self

Creates a new empty LineStringBuilder.

Source

pub fn with_capacity(typ: LineStringType, capacity: LineStringCapacity) -> Self

Creates a new LineStringBuilder with a capacity.

Source

pub fn reserve(&mut self, additional: LineStringCapacity)

Reserves capacity for at least additional more LineStrings.

The collection may reserve more space to speculatively avoid frequent reallocations. After calling reserve, capacity will be greater than or equal to self.len() + additional. Does nothing if capacity is already sufficient.

Source

pub fn reserve_exact(&mut self, additional: LineStringCapacity)

Reserves the minimum capacity for at least additional more LineStrings.

Unlike reserve, this will not deliberately over-allocate to speculatively avoid frequent allocations. After calling reserve_exact, capacity will be greater than or equal to self.len() + additional. Does nothing if the capacity is already sufficient.

Note that the allocator may give the collection more space than it requests. Therefore, capacity can not be relied upon to be precisely minimal. Prefer reserve if future insertions are expected.

Source

pub fn push_empty(&mut self)

Add a valid but empty LineString to the end of this array.

Source

pub fn finish(self) -> LineStringArray

Consume the builder and convert to an immutable LineStringArray

Source

pub fn from_line_strings( geoms: &[impl LineStringTrait<T = f64>], typ: LineStringType, ) -> Self

Construct a new builder, pre-filling it with the provided geometries

Source

pub fn from_nullable_line_strings( geoms: &[Option<impl LineStringTrait<T = f64>>], typ: LineStringType, ) -> Self

Construct a new builder, pre-filling it with the provided geometries

Source

pub fn push_line_string( &mut self, value: Option<&impl LineStringTrait<T = f64>>, ) -> GeoArrowResult<()>

Add a new LineString to the end of this array.

§Errors

This function errors iff the new last item is larger than what O supports.

Source

pub fn extend_from_iter<'a>( &mut self, geoms: impl Iterator<Item = Option<&'a (impl LineStringTrait<T = f64> + 'a)>>, )

Extend this builder with the given geometries

Source

pub fn extend_from_geometry_iter<'a>( &mut self, geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait<T = f64> + 'a)>>, ) -> GeoArrowResult<()>

Extend this builder with the given geometries

Source

pub fn push_geometry( &mut self, value: Option<&impl GeometryTrait<T = f64>>, ) -> GeoArrowResult<()>

Add a new geometry to this builder

This will error if the geometry type is not LineString or a MultiLineString with length 1.

Source

pub fn from_nullable_geometries( geoms: &[Option<impl GeometryTrait<T = f64>>], typ: LineStringType, ) -> GeoArrowResult<Self>

Construct a new builder, pre-filling it with the provided geometries

Trait Implementations§

Source§

impl Debug for LineStringBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<O: OffsetSizeTrait> TryFrom<(GenericWkbArray<O>, LineStringType)> for LineStringBuilder

Source§

type Error = GeoArrowError

The type returned in the event of a conversion error.
Source§

fn try_from( (value, typ): (GenericWkbArray<O>, LineStringType), ) -> GeoArrowResult<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,