Struct las::raw::vlr::Vlr[][src]

pub struct Vlr {
    pub reserved: u16,
    pub user_id: [u8; 16],
    pub record_id: u16,
    pub record_length_after_header: RecordLength,
    pub description: [u8; 32],
    pub data: Vec<u8>,
}

A raw variable length record.

Fields

reserved: u16

This value must be set to zero

user_id: [u8; 16]

The User ID field is ASCII character data that identifies the user which created the variable length record.

It is possible to have many Variable Length Records from different sources with different User IDs. If the character data is less than 16 characters, the remaining data must be null. The User ID must be registered with the LAS specification managing body. The management of these User IDs ensures that no two individuals accidentally use the same User ID.

record_id: u16

The Record ID is dependent upon the User ID.

There can be 0 to 65,535 Record IDs for every User ID. The LAS specification manages its own Record IDs (User IDs owned by the specification), otherwise Record IDs will be managed by the owner of the given User ID. Thus each User ID is allowed to assign 0 to 65,535 Record IDs in any manner they desire. Publicizing the meaning of a given Record ID is left to the owner of the given User ID. Unknown User ID/Record ID combinations should be ignored.

record_length_after_header: RecordLength

The record length is the number of bytes for the record after the end of the standard part of the header.

Thus the entire record length is 54 bytes (the header size of the VLR) plus the number of bytes in the variable length portion of the record.

description: [u8; 32]

Optional, null terminated text description of the data.

Any remaining characters not used must be null.

data: Vec<u8>

Implementations

impl Vlr[src]

pub fn read_from<R: Read>(mut read: R, extended: bool) -> Result<Vlr>[src]

Reads a raw VLR or EVLR.

Examples

use std::io::{Seek, SeekFrom};
use std::fs::File;
use las::raw::Vlr;
let mut file = File::open("tests/data/autzen.las").unwrap();
file.seek(SeekFrom::Start(227));
// If the second parameter were true, it would be read as an extended vlr.
let vlr = Vlr::read_from(file, false).unwrap();

pub fn write_to<W: Write>(&self, mut write: W) -> Result<()>[src]

Writes a raw VLR.

Examples

use std::io::Cursor;
use las::raw::Vlr;
let mut cursor = Cursor::new(Vec::new());
let vlr = Vlr::default();
vlr.write_to(cursor).unwrap();

Trait Implementations

impl Debug for Vlr[src]

impl Default for Vlr[src]

impl PartialEq<Vlr> for Vlr[src]

impl StructuralPartialEq for Vlr[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.