etsi014-client 0.1.2

ETSI GS QKD 014 client library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::error::ErrorType::InvalidArgument;
use crate::Error;
use std::fs;
use std::path::PathBuf;

pub fn read_file(path: &PathBuf) -> Result<Vec<u8>, Error> {
    fs::read(path).map_err(|e| {
        Error::new(
            format!("Error reading {path:#?}"),
            InvalidArgument,
            Some(Box::new(e)),
        )
    })
}