pub struct Layer01<'a, S: DecodeState = Lazy> {
pub name: &'a str,
pub extent: u32,
pub id: Option<Id<'a, S>>,
pub geometry: Geometry<'a, S>,
/* private fields */
}Expand description
Representation of an MLT feature table layer with tag 0x01 during decoding.
The type parameter S controls how columns are stored:
-
Layer01<'a>/Layer01<'a, Lazy>(default) — columns areLazyParsedenums that may be raw or decoded. Usedecode_id,decode_geometry,decode_propertiesfor selective in-place decoding, orLayer01::decode_allto transition toLayer01<Parsed>. -
Layer01<'a, Parsed>— all columns are fully decoded. The fieldsid,geometry, andpropertieshold the parsed types directly, allowing infallible readonly access. There is aParsedLayer01<'a>type alias for this.
Fields§
§name: &'a str§extent: u32§id: Option<Id<'a, S>>§geometry: Geometry<'a, S>Implementations§
Source§impl<'a> Layer01<'a, Lazy>
impl<'a> Layer01<'a, Lazy>
Sourcepub fn iterate_prop_names(&self) -> Layer01PropNamesIter<'_, 'a> ⓘ
pub fn iterate_prop_names(&self) -> Layer01PropNamesIter<'_, 'a> ⓘ
Iterate over the property column names of this layer, in order.
Regular columns yield one PropName; SharedDict columns yield one name per
sub-item. Names are available even before any column data has been decoded.
Pair with FeatureRef::iter_all_properties to associate per-feature
values with their column names.
Source§impl<'a> Layer01<'a, Parsed>
impl<'a> Layer01<'a, Parsed>
Sourcepub fn iter_features(&self) -> Layer01FeatureIter<'_, 'a> ⓘ
pub fn iter_features(&self) -> Layer01FeatureIter<'_, 'a> ⓘ
Iterate over all features in this fully-decoded layer.
Returns a Layer01FeatureIter that yields one FeatureRef
per feature. Construction is infallible; individual next() calls return
MltResult<FeatureRef> because geometry decoding can fail.
Sourcepub fn iterate_prop_names(&self) -> Layer01PropNamesIter<'_, 'a> ⓘ
pub fn iterate_prop_names(&self) -> Layer01PropNamesIter<'_, 'a> ⓘ
Iterate over the property column names of this layer, in order.
See Layer01::iterate_prop_names for details.
Source§impl<'a> Layer01<'a, Lazy>
impl<'a> Layer01<'a, Lazy>
Sourcepub fn from_bytes(input: &'a [u8], parser: &mut Parser) -> MltResult<Self>
pub fn from_bytes(input: &'a [u8], parser: &mut Parser) -> MltResult<Self>
Parse v01::Layer metadata, reserving decoded memory against the parser’s budget.
Sourcepub fn decode_id(
&mut self,
dec: &mut Decoder,
) -> MltResult<Option<&mut IdValues>>
pub fn decode_id( &mut self, dec: &mut Decoder, ) -> MltResult<Option<&mut IdValues>>
Decode only the ID column, leaving other columns in their encoded form.
Use this instead of Self::decode_all when other columns will be accessed lazily.
Sourcepub fn decode_geometry(
&mut self,
dec: &mut Decoder,
) -> MltResult<&mut GeometryValues>
pub fn decode_geometry( &mut self, dec: &mut Decoder, ) -> MltResult<&mut GeometryValues>
Decode only the geometry column, leaving other columns in their encoded form.
Use this instead of Self::decode_all when other columns will be accessed lazily.
Sourcepub fn decode_properties(&mut self, dec: &mut Decoder) -> MltResult<()>
pub fn decode_properties(&mut self, dec: &mut Decoder) -> MltResult<()>
Decode only the property columns, leaving other columns in their encoded form.
Use this instead of Self::decode_all when other columns will be accessed lazily.
Sourcepub fn decode_all(self, dec: &mut Decoder) -> MltResult<ParsedLayer01<'a>>
pub fn decode_all(self, dec: &mut Decoder) -> MltResult<ParsedLayer01<'a>>
Decode all columns and transition to Layer01<Parsed>.
Consumes self (a Layer01<Lazy>) and returns a Layer01<Parsed> where every
column field holds its parsed value directly, enabling infallible readonly access.
Source§impl Layer01<'_, Parsed>
impl Layer01<'_, Parsed>
Sourcepub fn into_tile(self, dec: &mut Decoder) -> MltResult<TileLayer01>
pub fn into_tile(self, dec: &mut Decoder) -> MltResult<TileLayer01>
Decode and convert into a row-oriented TileLayer01, charging every
heap allocation against dec.
pub fn feature_count(&self) -> usize
Source§impl Layer01<'_>
impl Layer01<'_>
Sourcepub fn into_tile(self, dec: &mut Decoder) -> MltResult<TileLayer01>
pub fn into_tile(self, dec: &mut Decoder) -> MltResult<TileLayer01>
Decode and convert into a row-oriented TileLayer01
Trait Implementations§
Source§impl<'a, S: DecodeState> Analyze for Layer01<'a, S>
impl<'a, S: DecodeState> Analyze for Layer01<'a, S>
fn collect_statistic(&self, stat: StatType) -> usize
Source§fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))
fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))
cb with the StreamMeta of every stream contained in self.
Default implementation is a no-op (types that hold no streams).Auto Trait Implementations§
impl<'a, S> Freeze for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: Freeze,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: Freeze,
impl<'a, S> RefUnwindSafe for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: RefUnwindSafe,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: RefUnwindSafe,
<S as DecodeState>::LazyOrParsed<RawProperty<'a>, ParsedProperty<'a>>: RefUnwindSafe,
impl<'a, S> Send for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: Send,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: Send,
<S as DecodeState>::LazyOrParsed<RawProperty<'a>, ParsedProperty<'a>>: Send,
impl<'a, S> Sync for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: Sync,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: Sync,
<S as DecodeState>::LazyOrParsed<RawProperty<'a>, ParsedProperty<'a>>: Sync,
impl<'a, S> Unpin for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: Unpin,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: Unpin,
<S as DecodeState>::LazyOrParsed<RawProperty<'a>, ParsedProperty<'a>>: Unpin,
impl<'a, S> UnsafeUnpin for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: UnsafeUnpin,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: UnsafeUnpin,
impl<'a, S> UnwindSafe for Layer01<'a, S>where
<S as DecodeState>::LazyOrParsed<RawGeometry<'a>, GeometryValues>: UnwindSafe,
<S as DecodeState>::LazyOrParsed<RawId<'a>, IdValues>: UnwindSafe,
<S as DecodeState>::LazyOrParsed<RawProperty<'a>, ParsedProperty<'a>>: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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