Struct timewarrior_report::TimewarriorData[][src]

pub struct TimewarriorData {
    pub config: HashMap<String, String>,
    pub sessions: Vec<Session>,
}
Expand description

A representation of the data within the report

Fields

config: HashMap<String, String>

The configurations passed to the report

sessions: Vec<Session>

A vector of all tracked sessions within the report

Implementations

Read the report from standard input

This should be the usual way to read the report data.

Read the report from a given string

Example

use timewarrior_report::TimewarriorData;

let report_data = TimewarriorData::from_string("test: test\n\n[]".into()).unwrap();
assert_eq!(
    report_data,
    TimewarriorData {
        config: [("test".to_string(), "test".to_string())]
            .iter()
            .cloned()
            .collect(),
        sessions: Vec::new(),
    }
);

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.