pub struct PolygonCapacity { /* private fields */ }
Expand description
A counter for the buffer sizes of a PolygonArray
.
This can be used to reduce allocations by allocating once for exactly the array size you need.
Implementations§
Source§impl PolygonCapacity
impl PolygonCapacity
Sourcepub fn new(
coord_capacity: usize,
ring_capacity: usize,
geom_capacity: usize,
) -> Self
pub fn new( coord_capacity: usize, ring_capacity: usize, geom_capacity: usize, ) -> Self
Create a new capacity with known sizes.
Sourcepub fn coord_capacity(&self) -> usize
pub fn coord_capacity(&self) -> usize
The coordinate buffer capacity
Sourcepub fn ring_capacity(&self) -> usize
pub fn ring_capacity(&self) -> usize
The ring offset buffer capacity
Sourcepub fn geom_capacity(&self) -> usize
pub fn geom_capacity(&self) -> usize
The geometry offset buffer capacity
Sourcepub fn add_polygon<'a>(&mut self, polygon: Option<&'a (impl PolygonTrait + 'a)>)
pub fn add_polygon<'a>(&mut self, polygon: Option<&'a (impl PolygonTrait + 'a)>)
Add the capacity of the given Polygon
Sourcepub fn add_rect<'a>(&mut self, rect: Option<&'a (impl RectTrait + 'a)>)
pub fn add_rect<'a>(&mut self, rect: Option<&'a (impl RectTrait + 'a)>)
Add the capacity of the given Rect
Sourcepub fn add_geometry(
&mut self,
value: Option<&impl GeometryTrait>,
) -> GeoArrowResult<()>
pub fn add_geometry( &mut self, value: Option<&impl GeometryTrait>, ) -> GeoArrowResult<()>
Add the capacity of the given Geometry
The type of the geometry must be either Polygon or Rect
Sourcepub fn from_polygons<'a>(
geoms: impl Iterator<Item = Option<&'a (impl PolygonTrait + 'a)>>,
) -> Self
pub fn from_polygons<'a>( geoms: impl Iterator<Item = Option<&'a (impl PolygonTrait + 'a)>>, ) -> Self
Construct a new counter pre-filled with the given Polygons
Sourcepub fn from_rects<'a>(
geoms: impl Iterator<Item = Option<&'a (impl RectTrait + 'a)>>,
) -> Self
pub fn from_rects<'a>( geoms: impl Iterator<Item = Option<&'a (impl RectTrait + 'a)>>, ) -> Self
Construct a new counter pre-filled with the given Rects
Sourcepub fn from_geometries<'a>(
geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait + 'a)>>,
) -> GeoArrowResult<Self>
pub fn from_geometries<'a>( geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait + 'a)>>, ) -> GeoArrowResult<Self>
Construct a new counter pre-filled with the given geometries
Trait Implementations§
Source§impl Add for PolygonCapacity
impl Add for PolygonCapacity
Source§impl AddAssign<PolygonCapacity> for MultiPolygonCapacity
impl AddAssign<PolygonCapacity> for MultiPolygonCapacity
Source§fn add_assign(&mut self, rhs: PolygonCapacity)
fn add_assign(&mut self, rhs: PolygonCapacity)
Performs the
+=
operation. Read moreSource§impl Clone for PolygonCapacity
impl Clone for PolygonCapacity
Source§fn clone(&self) -> PolygonCapacity
fn clone(&self) -> PolygonCapacity
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PolygonCapacity
impl Debug for PolygonCapacity
Source§impl Default for PolygonCapacity
impl Default for PolygonCapacity
impl Copy for PolygonCapacity
Auto Trait Implementations§
impl Freeze for PolygonCapacity
impl RefUnwindSafe for PolygonCapacity
impl Send for PolygonCapacity
impl Sync for PolygonCapacity
impl Unpin for PolygonCapacity
impl UnwindSafe for PolygonCapacity
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