pub struct MutablePolygonArray<O: OffsetSizeTrait> { /* private fields */ }
Expand description
The Arrow equivalent to Vec<Option<Polygon>>
.
Converting a MutablePolygonArray
into a PolygonArray
is O(1)
.
Implementations§
Source§impl<O: OffsetSizeTrait> MutablePolygonArray<O>
impl<O: OffsetSizeTrait> MutablePolygonArray<O>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty MutablePolygonArray
.
Sourcepub fn with_capacities(
coord_capacity: usize,
ring_capacity: usize,
geom_capacity: usize,
) -> Self
pub fn with_capacities( coord_capacity: usize, ring_capacity: usize, geom_capacity: usize, ) -> Self
Creates a new MutablePolygonArray
with given capacities and no validity.
Sourcepub fn reserve(
&mut self,
coord_additional: usize,
ring_additional: usize,
geom_additional: usize,
)
pub fn reserve( &mut self, coord_additional: usize, ring_additional: usize, geom_additional: usize, )
Reserves capacity for at least additional
more LineStrings to be inserted
in the given Vec<T>
. 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.
Sourcepub fn reserve_exact(
&mut self,
coord_additional: usize,
ring_additional: usize,
geom_additional: usize,
)
pub fn reserve_exact( &mut self, coord_additional: usize, ring_additional: usize, geom_additional: usize, )
Reserves the minimum capacity for at least additional
more LineStrings to
be inserted in the given Vec<T>
. 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.
Sourcepub fn try_new(
coords: MutableCoordBuffer,
geom_offsets: OffsetsBuilder<O>,
ring_offsets: OffsetsBuilder<O>,
validity: NullBufferBuilder,
) -> Result<Self>
pub fn try_new( coords: MutableCoordBuffer, geom_offsets: OffsetsBuilder<O>, ring_offsets: OffsetsBuilder<O>, validity: NullBufferBuilder, ) -> Result<Self>
The canonical method to create a MutablePolygonArray
out of its internal components.
§Implementation
This function is O(1)
.
§Errors
- if the validity is not
None
and its length is different from the number of geometries - if the largest ring offset does not match the number of coordinates
- if the largest geometry offset does not match the size of ring offsets
Sourcepub fn into_inner(
self,
) -> (MutableCoordBuffer, OffsetsBuilder<O>, OffsetsBuilder<O>, NullBufferBuilder)
pub fn into_inner( self, ) -> (MutableCoordBuffer, OffsetsBuilder<O>, OffsetsBuilder<O>, NullBufferBuilder)
Extract the low-level APIs from the MutablePolygonArray
.
pub fn into_array_ref(self) -> Arc<dyn Array>
Sourcepub fn push_polygon(
&mut self,
value: Option<&impl PolygonTrait<T = f64>>,
) -> Result<()>
pub fn push_polygon( &mut self, value: Option<&impl PolygonTrait<T = f64>>, ) -> Result<()>
Add a new Polygon to the end of this array.
§Errors
This function errors iff the new last item is larger than what O supports.
Sourcepub unsafe fn try_push_geom_offset(
&mut self,
offsets_length: usize,
) -> Result<()>
pub unsafe fn try_push_geom_offset( &mut self, offsets_length: usize, ) -> Result<()>
Push a raw offset to the underlying geometry offsets buffer.
§Safety
This is marked as unsafe because care must be taken to ensure that pushing raw offsets upholds the necessary invariants of the array.
Trait Implementations§
Source§impl<O: Debug + OffsetSizeTrait> Debug for MutablePolygonArray<O>
impl<O: Debug + OffsetSizeTrait> Debug for MutablePolygonArray<O>
Source§impl<O: OffsetSizeTrait> Default for MutablePolygonArray<O>
impl<O: OffsetSizeTrait> Default for MutablePolygonArray<O>
Source§impl<O: OffsetSizeTrait> From<MutableMultiLineStringArray<O>> for MutablePolygonArray<O>
Polygon and MultiLineString have the same layout, so enable conversions between the two to
change the semantic type
impl<O: OffsetSizeTrait> From<MutableMultiLineStringArray<O>> for MutablePolygonArray<O>
Polygon and MultiLineString have the same layout, so enable conversions between the two to change the semantic type
Source§fn from(value: MutableMultiLineStringArray<O>) -> Self
fn from(value: MutableMultiLineStringArray<O>) -> Self
Source§impl<O: OffsetSizeTrait> From<MutablePolygonArray<O>> for MutableMultiLineStringArray<O>
Polygon and MultiLineString have the same layout, so enable conversions between the two to
change the semantic type
impl<O: OffsetSizeTrait> From<MutablePolygonArray<O>> for MutableMultiLineStringArray<O>
Polygon and MultiLineString have the same layout, so enable conversions between the two to change the semantic type
Source§fn from(value: MutablePolygonArray<O>) -> Self
fn from(value: MutablePolygonArray<O>) -> Self
Source§impl<O: OffsetSizeTrait> From<MutablePolygonArray<O>> for PolygonArray<O>
impl<O: OffsetSizeTrait> From<MutablePolygonArray<O>> for PolygonArray<O>
Source§fn from(other: MutablePolygonArray<O>) -> Self
fn from(other: MutablePolygonArray<O>) -> Self
Source§impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<'_, G>> for MutablePolygonArray<O>
impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<'_, G>> for MutablePolygonArray<O>
Source§impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<'_, Option<G>>> for MutablePolygonArray<O>
impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<'_, Option<G>>> for MutablePolygonArray<O>
Source§impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<G>> for MutablePolygonArray<O>
impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<G>> for MutablePolygonArray<O>
Source§impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<Option<G>>> for MutablePolygonArray<O>
impl<O: OffsetSizeTrait, G: PolygonTrait<T = f64>> From<Vec<Option<G>>> for MutablePolygonArray<O>
Source§impl<O: OffsetSizeTrait> IntoArrow for MutablePolygonArray<O>
impl<O: OffsetSizeTrait> IntoArrow for MutablePolygonArray<O>
type ArrowArray = GenericListArray<O>
fn into_arrow(self) -> Self::ArrowArray
Source§impl<O: OffsetSizeTrait> TryFrom<WKBArray<O>> for MutablePolygonArray<O>
impl<O: OffsetSizeTrait> TryFrom<WKBArray<O>> for MutablePolygonArray<O>
Auto Trait Implementations§
impl<O> Freeze for MutablePolygonArray<O>
impl<O> RefUnwindSafe for MutablePolygonArray<O>where
O: RefUnwindSafe,
impl<O> Send for MutablePolygonArray<O>
impl<O> Sync for MutablePolygonArray<O>
impl<O> Unpin for MutablePolygonArray<O>where
O: Unpin,
impl<O> UnwindSafe for MutablePolygonArray<O>where
O: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more