edjr 0.1.1

Elite Dangerous Journal Reader
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use {
    crate::error::JournalError,
    std::{fs::File, path::Path},
};

pub struct Journal<F> {
    pub(crate) file: F,
}

impl Journal<File> {
    pub fn open(path: impl AsRef<Path>) -> Result<Journal<File>, JournalError> {
        let file = File::open(path).map_err(|err| JournalError::OpenError(err))?;

        Ok(Self { file })
    }
}