#[non_exhaustive]pub struct TileInput {
pub x: i32,
pub z: i32,
pub cell_class: u32,
pub bmin: [f32; 3],
pub bmax: [f32; 3],
pub groups: Vec<TileGroup>,
}Expand description
A tile input message (id 5): one tile’s geometry.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.x: i32Tile x.
z: i32Tile z.
cell_class: u32Index into the cell-class list.
bmin: [f32; 3]Tile bounds minimum.
bmax: [f32; 3]Tile bounds maximum.
groups: Vec<TileGroup>The geometry groups.
Implementations§
Source§impl TileInput
impl TileInput
Sourcepub fn parse(payload: &[u8]) -> Result<Self>
pub fn parse(payload: &[u8]) -> Result<Self>
Parses a tile input payload.
§Errors
Fails with the texts of spec 12.1: “message truncated”, “implausible group count N”, “implausible part count N”, “implausible vertex count N”, “part vertex range out of bounds”, “non-finite vertex” and “unexpected bytes after tile record”.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encodes the payload.
Counts above the wire’s range are clamped; no real value comes near that.
Sourcepub fn part_vertex_range(
&self,
group: usize,
part: usize,
) -> Option<Range<usize>>
pub fn part_vertex_range( &self, group: usize, part: usize, ) -> Option<Range<usize>>
The vertex range of part part of group group: from its first_vertex to the next part’s
(or the end of the group’s vertices for the last part). None when the group or part does not
exist or the range is out of bounds.
Trait Implementations§
impl StructuralPartialEq for TileInput
Auto Trait Implementations§
impl Freeze for TileInput
impl RefUnwindSafe for TileInput
impl Send for TileInput
impl Sync for TileInput
impl Unpin for TileInput
impl UnsafeUnpin for TileInput
impl UnwindSafe for TileInput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().