Struct las::Version[][src]

pub struct Version {
    pub major: u8,
    pub minor: u8,
}

LAS version.

Defaults to 1.2.

Fields

major: u8

The major version.

Should always be 1.

minor: u8

The minor version.

Should be between 0 and 4.

Implementations

impl Version[src]

pub fn new(major: u8, minor: u8) -> Version[src]

Creates a new version.

Doesn't do any checking that its an actual las version

Examples

use las::Version;
let version = Version::new(1, 2);

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

Does this version require the point data start signature?

Only 1.0 does.

use las::Version;
assert!(Version::new(1, 0).requires_point_data_start_signature());
assert!(!Version::new(1, 1).requires_point_data_start_signature());

pub fn header_size(&self) -> u16[src]

Returns this version's header size.

Examples

use las::Version;
assert_eq!(227, Version::new(1, 2).header_size());
assert_eq!(235, Version::new(1, 3).header_size());
assert_eq!(375, Version::new(1, 4).header_size());

pub fn verify_support_for<F: Feature>(&self) -> Result<()>[src]

Checks whether this version supports the feature, returning an error if not.

Examples

use las::Version;
use las::feature::Waveforms;
Version::new(1, 4).verify_support_for::<Waveforms>().unwrap();
assert!(Version::new(1, 2).verify_support_for::<Waveforms>().is_err());

pub fn supports<F: Feature>(&self) -> bool[src]

Checks whether this version supports the feature.

Examples

use las::Version;
use las::feature::Waveforms;
assert!(Version::new(1, 4).supports::<Waveforms>());
assert!(!Version::new(1, 2).supports::<Waveforms>());

pub fn supports_point_format(&self, format: Format) -> bool[src]

Checks whether this version supports the given point format.

Examples

use las::Version;
use las::point::Format;
let las_1_2 = Version::new(1, 2);
let las_1_4 = Version::new(1, 4);
assert!(las_1_2.supports_point_format(Format::new(3).unwrap()));
assert!(!las_1_2.supports_point_format(Format::new(4).unwrap()));
assert!(las_1_4.supports_point_format(Format::new(4).unwrap()));

Trait Implementations

impl Clone for Version[src]

impl Copy for Version[src]

impl Debug for Version[src]

impl Default for Version[src]

impl Display for Version[src]

impl Eq for Version[src]

impl From<(u8, u8)> for Version[src]

impl Ord for Version[src]

impl PartialEq<Version> for Version[src]

impl PartialOrd<Version> for Version[src]

impl StructuralEq for Version[src]

impl StructuralPartialEq for Version[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> ToString for T where
    T: Display + ?Sized
[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.