Struct las::vlr::Vlr

source ·
pub struct Vlr {
    pub user_id: String,
    pub record_id: u16,
    pub description: String,
    pub data: Vec<u8>,
}
Expand description

A variable length record.

Fields§

§user_id: String

The user that created this record.

This value is often an official, “registered” user_id, such as “LASF_Spec” or “LASF_Projection”.

§record_id: u16

This value specifies the type of record, and depends on the user id.

§description: String

Textual description of these data.

§data: Vec<u8>

The data themselves.

Implementations§

Creates a vlr from a raw vlr.

Examples
use las::{Vlr, raw};
let raw_vlr = raw::Vlr::default();
let vlr = Vlr::new(raw_vlr);

Converts this vlr to a raw vlr.

Examples
use las::Vlr;
let raw_vlr =  Vlr::default().into_raw(false).unwrap();
let raw_evlr =  Vlr::default().into_raw(true).unwrap();

Returns the total length of this vlr, header and data.

Examples
use las::Vlr;

let mut vlr = Vlr::default();
assert_eq!(54, vlr.len(false));
assert_eq!(60, vlr.len(true));
vlr.data = vec![0];
assert_eq!(55, vlr.len(false));

Returns true if the data of this vlr is empty.

Examples
use las::Vlr;
let mut vlr = Vlr::default();
assert!(vlr.is_empty());
vlr.data = vec![42];
assert!(!vlr.is_empty());

Returns true if this vlr must be extended due to large data size.

Examples
use las::Vlr;
use std::u16;
let mut vlr = Vlr::default();
assert!(!vlr.has_large_data());
vlr.data = vec![0; u16::MAX as usize + 1 ];
assert!(vlr.has_large_data());

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.