Skip to main content

Layer01

Struct Layer01 

Source
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 are LazyParsed enums that may be raw or decoded. Use decode_id, decode_geometry, decode_properties for selective in-place decoding, or Layer01::decode_all to transition to Layer01<Parsed>.

  • Layer01<'a, Parsed> — all columns are fully decoded. The fields id, geometry, and properties hold the parsed types directly, allowing infallible readonly access. There is a ParsedLayer01<'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>

Source

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>

Source

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.

Source

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>

Source

pub fn from_bytes(input: &'a [u8], parser: &mut Parser) -> MltResult<Self>

Parse v01::Layer metadata, reserving decoded memory against the parser’s budget.

Source

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.

Source

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.

Source

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.

Source

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>

Source

pub fn into_tile(self, dec: &mut Decoder) -> MltResult<TileLayer01>

Decode and convert into a row-oriented TileLayer01, charging every heap allocation against dec.

Source

pub fn feature_count(&self) -> usize

Source§

impl Layer01<'_>

Source

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>
where Option<Id<'a, S>>: Analyze, Geometry<'a, S>: Analyze, Vec<Property<'a, S>>: Analyze,

Source§

fn collect_statistic(&self, stat: StatType) -> usize

Source§

fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))

Call cb with the StreamMeta of every stream contained in self. Default implementation is a no-op (types that hold no streams).
Source§

impl<'a, S> Clone for Layer01<'a, S>
where S: DecodeState, Option<Id<'a, S>>: Clone, Geometry<'a, S>: Clone, Vec<Property<'a, S>>: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, S> Debug for Layer01<'a, S>
where S: DecodeState, Option<Id<'a, S>>: Debug, Geometry<'a, S>: Debug, Vec<Property<'a, S>>: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, S> PartialEq for Layer01<'a, S>
where S: DecodeState, Option<Id<'a, S>>: PartialEq, Geometry<'a, S>: PartialEq, Vec<Property<'a, S>>: PartialEq,

TODO: not certain this is needed

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<'a, S> Freeze for Layer01<'a, S>

§

impl<'a, S> RefUnwindSafe for Layer01<'a, S>

§

impl<'a, S> Send for Layer01<'a, S>

§

impl<'a, S> Sync for Layer01<'a, S>

§

impl<'a, S> Unpin for Layer01<'a, S>

§

impl<'a, S> UnsafeUnpin for Layer01<'a, S>

§

impl<'a, S> UnwindSafe for Layer01<'a, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool