pub struct LineStringCapacity { /* private fields */ }
Expand description
A counter for the buffer sizes of a LineStringArray
.
This can be used to reduce allocations by allocating once for exactly the array size you need.
Implementations§
Source§impl LineStringCapacity
impl LineStringCapacity
Sourcepub fn new(coord_capacity: usize, geom_capacity: usize) -> Self
pub fn new(coord_capacity: usize, geom_capacity: usize) -> Self
Create a new capacity with known sizes.
Sourcepub fn add_line_string(
&mut self,
maybe_line_string: Option<&impl LineStringTrait>,
)
pub fn add_line_string( &mut self, maybe_line_string: Option<&impl LineStringTrait>, )
Add a LineString to this capacity counter.
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 LineString
Sourcepub fn coord_capacity(&self) -> usize
pub fn coord_capacity(&self) -> usize
The coordinate buffer capacity
Sourcepub fn geom_capacity(&self) -> usize
pub fn geom_capacity(&self) -> usize
The geometry offset buffer capacity
Sourcepub fn from_line_strings<'a>(
geoms: impl Iterator<Item = Option<&'a (impl LineStringTrait + 'a)>>,
) -> Self
pub fn from_line_strings<'a>( geoms: impl Iterator<Item = Option<&'a (impl LineStringTrait + 'a)>>, ) -> Self
Create a capacity counter from an iterator of LineStrings.
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 LineStringCapacity
impl Add for LineStringCapacity
Source§impl AddAssign<LineStringCapacity> for MultiLineStringCapacity
impl AddAssign<LineStringCapacity> for MultiLineStringCapacity
Source§fn add_assign(&mut self, rhs: LineStringCapacity)
fn add_assign(&mut self, rhs: LineStringCapacity)
Performs the
+=
operation. Read moreSource§impl Clone for LineStringCapacity
impl Clone for LineStringCapacity
Source§fn clone(&self) -> LineStringCapacity
fn clone(&self) -> LineStringCapacity
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 LineStringCapacity
impl Debug for LineStringCapacity
Source§impl Default for LineStringCapacity
impl Default for LineStringCapacity
impl Copy for LineStringCapacity
Auto Trait Implementations§
impl Freeze for LineStringCapacity
impl RefUnwindSafe for LineStringCapacity
impl Send for LineStringCapacity
impl Sync for LineStringCapacity
impl Unpin for LineStringCapacity
impl UnwindSafe for LineStringCapacity
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