pub struct MultiPolygonCapacity { /* private fields */ }
Expand description
A counter for the buffer sizes of a MultiPolygonArray
.
This can be used to reduce allocations by allocating once for exactly the array size you need.
Implementations§
Source§impl MultiPolygonCapacity
impl MultiPolygonCapacity
Sourcepub fn new(
coord_capacity: usize,
ring_capacity: usize,
polygon_capacity: usize,
geom_capacity: usize,
) -> Self
pub fn new( coord_capacity: usize, ring_capacity: usize, polygon_capacity: usize, geom_capacity: usize, ) -> Self
Create a new capacity with known sizes.
pub fn coord_capacity(&self) -> usize
pub fn ring_capacity(&self) -> usize
pub fn polygon_capacity(&self) -> usize
pub fn geom_capacity(&self) -> usize
pub fn add_polygon<'a>(&mut self, polygon: Option<&'a (impl PolygonTrait + 'a)>)
pub fn add_multi_polygon<'a>( &mut self, multi_polygon: Option<&'a (impl MultiPolygonTrait + 'a)>, )
pub fn add_polygon_capacity(&mut self, capacity: PolygonCapacity)
pub fn from_multi_polygons<'a>( geoms: impl Iterator<Item = Option<&'a (impl MultiPolygonTrait + 'a)>>, ) -> Self
Sourcepub fn num_bytes<O: OffsetSizeTrait>(&self) -> usize
pub fn num_bytes<O: OffsetSizeTrait>(&self) -> usize
The number of bytes an array with this capacity would occupy.
Trait Implementations§
Source§impl Add for MultiPolygonCapacity
impl Add for MultiPolygonCapacity
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 AddAssign for MultiPolygonCapacity
impl AddAssign for MultiPolygonCapacity
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl Clone for MultiPolygonCapacity
impl Clone for MultiPolygonCapacity
Source§fn clone(&self) -> MultiPolygonCapacity
fn clone(&self) -> MultiPolygonCapacity
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 MultiPolygonCapacity
impl Debug for MultiPolygonCapacity
Source§impl Default for MultiPolygonCapacity
impl Default for MultiPolygonCapacity
impl Copy for MultiPolygonCapacity
Auto Trait Implementations§
impl Freeze for MultiPolygonCapacity
impl RefUnwindSafe for MultiPolygonCapacity
impl Send for MultiPolygonCapacity
impl Sync for MultiPolygonCapacity
impl Unpin for MultiPolygonCapacity
impl UnwindSafe for MultiPolygonCapacity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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