kataglyphis_rustprojecttemplate/platform/native.rs
1use anyhow::{Context, Result};
2use std::path::Path;
3
4/// Native implementation of file read using async tokio IO.
5pub async fn read_file(path: impl AsRef<Path>) -> Result<String> {
6 tokio::fs::read_to_string(path.as_ref())
7 .await
8 .with_context(|| format!("Failed to read file at '{}'", path.as_ref().display()))
9}
10
11// Re-export any other native-only utilities here.
12pub use crate::utils::FileStats;
13
14#[flutter_rust_bridge::frb(init)]
15pub fn init_app() {
16 // Default utilities - feel free to customize
17 flutter_rust_bridge::setup_default_user_utils();
18}