Comments.

Coverage to Makefile.toml.

Added branch to map! to allow for instantiating with default values.
This commit is contained in:
Martin Berg Alstad
2024-08-31 17:49:27 +02:00
parent 8fb89e0459
commit 7e2df67fee
10 changed files with 95 additions and 4 deletions

View File

@ -1,5 +1,10 @@
use {std::io::Error, tokio::fs::File, tokio_util::io::ReaderStream};
/// Loads a file from the file system and returns a stream of bytes.
/// # Arguments
/// * `file_path` - The path to the file to load.
/// # Returns
/// A stream of bytes from the file if the file is found. Otherwise, an error is returned.
pub async fn load_file<Path>(file_path: Path) -> Result<ReaderStream<File>, Error>
where
Path: AsRef<std::path::Path>,