use std::path::Path; use anyhow::{Context, Result}; use crate::is_binary; impl crate::ForgeFS { pub fn exists>(path: T) -> bool { path.as_ref().exists() } pub async fn is_binary_file>(path: T) -> anyhow::Result { is_binary(path).await } pub fn is_file>(path: T) -> bool { path.as_ref().is_file() } pub async fn read_dir>(path: T) -> Result { tokio::fs::read_dir(path.as_ref()) .await .with_context(|| format!("Failed to read directory {}", path.as_ref().display())) } }