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
impl Vlr
sourcepub fn new(raw_vlr: Vlr) -> Vlr
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);
sourcepub fn into_raw(self, is_extended: bool) -> Result<Vlr>
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();
sourcepub fn len(&self, is_extended: bool) -> usize
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));
sourcepub fn is_empty(&self) -> bool
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());
sourcepub fn has_large_data(&self) -> bool
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§
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> 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