hermes_runtime_components/traits/fs/read_file.rs
1use alloc::string::String;
2
3use cgp::prelude::*;
4
5use crate::traits::fs::file_path::HasFilePathType;
6
7#[derive_component(FileAsStringReaderComponent, FileAsStringReader<Runtime>)]
8#[async_trait]
9pub trait CanReadFileAsString: HasFilePathType + HasErrorType {
10 async fn read_file_as_string(&self, file_path: &Self::FilePath) -> Result<String, Self::Error>;
11}