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

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

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

impl Vlr[src]

pub fn new(raw_vlr: Vlr) -> Vlr[src]

Creates a vlr from a raw vlr.

Examples

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

pub fn into_raw(self, is_extended: bool) -> Result<Vlr>[src]

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();

pub fn len(&self, is_extended: bool) -> usize[src]

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));

pub fn is_empty(&self) -> bool[src]

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());

pub fn has_large_data(&self) -> bool[src]

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

impl Clone for Vlr[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.