mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
14 lines
282 B
Rust
14 lines
282 B
Rust
use crate::asyncify;
|
|
|
|
use std::fs::Metadata;
|
|
use std::io;
|
|
use std::path::Path;
|
|
|
|
/// Queries the file system metadata for a path.
|
|
pub async fn metadata<P>(path: P) -> io::Result<Metadata>
|
|
where
|
|
P: AsRef<Path> + Send + 'static,
|
|
{
|
|
asyncify(|| std::fs::metadata(&path)).await
|
|
}
|