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§

source§

impl Vlr

source

pub fn new(raw_vlr: Vlr) -> Vlr

Creates a vlr from a raw vlr.

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

pub fn into_raw(self, is_extended: bool) -> Result<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();
source

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

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

pub fn is_empty(&self) -> bool

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

pub fn has_large_data(&self) -> bool

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§

source§

impl Clone for Vlr

source§

fn clone(&self) -> Vlr

Returns a copy 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 Debug for Vlr

source§

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

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

impl Default for Vlr

source§

fn default() -> Vlr

Returns the “default value” for a type. Read more
source§

impl PartialEq for Vlr

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Vlr

Auto Trait Implementations§

§

impl Freeze for Vlr

§

impl RefUnwindSafe for Vlr

§

impl Send for Vlr

§

impl Sync for Vlr

§

impl Unpin for Vlr

§

impl UnwindSafe for Vlr

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.