Skip to main content

Module clear

Module clear 

Source
Expand description

clear(&mut g) — empty the backing storage in place.

Mirrors boost::geometry::clear from boost/geometry/algorithms/clear.hpp. Per-kind:

  • Linestring, Ring, MultiPointVec::clear on the backing.
  • Polygon → clear the outer ring and drop every inner ring.
  • MultiLinestring, MultiPolygonVec::clear on the member vector.
  • Point, Box, Segment → no impl (fixed-size storage — there is nothing to clear).

Boost ships the fixed-size case as a silent no-op fall-through (clear.hpp); the Rust port instead simply provides no [Clear] impl for Point / Box / Segment, so clear(&mut point) is a compile error — the type system says “call this on something that has clearable storage.”

Functions§

clear
Empty the backing storage of g in place.