[][src]Struct igc::records::CRecordDeclaration

pub struct CRecordDeclaration<'a> {
    pub date: Date,
    pub time: Time,
    pub flight_date: Option<Date>,
    pub task_id: u16,
    pub turnpoint_count: i8,
    pub task_name: Option<&'a str>,
}

The first flavor of C Record - a task record which defines some properties of the whole task.

The IGC specification states that a conforming file containing a task declaration will contain a CRecordDeclaration, immediately followed (turnpoint_count + 4) CRecordTurnpoints. The extra 4 turnpoints are for the takeoff/land locations, and the task start/finish locations

Fields

date: Datetime: Timeflight_date: Option<Date>task_id: u16turnpoint_count: i8task_name: Option<&'a str>

Methods

impl<'a> CRecordDeclaration<'a>[src]

pub fn parse(line: &'a str) -> Result<Self, ParseError>[src]

Parse a string as a C record task declaration

let record = CRecordDeclaration::parse("C230718092044000000000204Foo task").unwrap();
assert_eq!(record.date, Date::from_dmy(23, 7, 18));
assert_eq!(record.time, Time::from_hms(9, 20, 44));
assert_eq!(record.task_id, 2);
assert_eq!(record.turnpoint_count, 4);
assert_eq!(record.task_name, Some("Foo task"));

Trait Implementations

impl<'a> Eq for CRecordDeclaration<'a>[src]

impl<'a> PartialEq<CRecordDeclaration<'a>> for CRecordDeclaration<'a>[src]

impl<'a> Debug for CRecordDeclaration<'a>[src]

impl<'a> Display for CRecordDeclaration<'a>[src]

Auto Trait Implementations

impl<'a> Send for CRecordDeclaration<'a>

impl<'a> Sync for CRecordDeclaration<'a>

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]