Struct RectBuilder

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

The GeoArrow equivalent to Vec<Option<Rect>>: a mutable collection of Rects.

Converting an RectBuilder into a RectArray is O(1).

Implementations§

Source§

impl RectBuilder

Source

pub fn new(typ: BoxType) -> Self

Creates a new empty RectBuilder.

Source

pub fn with_capacity(typ: BoxType, capacity: usize) -> Self

Creates a new RectBuilder with a capacity.

Source

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

Reserves capacity for at least additional more Rects.

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: usize)

Reserves the minimum capacity for at least additional more Rects.

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 try_new( lower: SeparatedCoordBufferBuilder, upper: SeparatedCoordBufferBuilder, validity: NullBufferBuilder, data_type: BoxType, ) -> GeoArrowResult<Self>

The canonical method to create a RectBuilder out of its internal components.

§Implementation

This function is O(1).

§Errors

This function errors iff:

  • The validity is not None and its length is different from the number of geometries
Source

pub fn finish(self) -> RectArray

Consume the builder and convert to an immutable RectArray

Source

pub fn push_rect(&mut self, value: Option<&impl RectTrait<T = f64>>)

Add a new Rect to the end of this builder.

Source

pub fn push_null(&mut self)

Add a new null value to the end of this builder.

Source

pub fn push_min_max( &mut self, min: &impl CoordTrait<T = f64>, max: &impl CoordTrait<T = f64>, )

Push min and max coordinates of a rect to the builder.

Source

pub fn from_rects<'a>( geoms: impl ExactSizeIterator<Item = &'a (impl RectTrait<T = f64> + 'a)>, typ: BoxType, ) -> Self

Create this builder from a iterator of Rects.

Source

pub fn from_nullable_rects<'a>( geoms: impl ExactSizeIterator<Item = Option<&'a (impl RectTrait<T = f64> + 'a)>>, typ: BoxType, ) -> Self

Create this builder from a iterator of nullable Rects.

Trait Implementations§

Source§

impl Debug for RectBuilder

Source§

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

Formats the value using the given formatter. Read more

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,