kernal-api 0.1.14

Async OS HAL, profiling, symbolization, and allocator instrumentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Cfg-free descriptor-based scratch cleanup backend.

pub(crate) struct Anchor(cap_std::fs::Dir);

impl Anchor {
    pub(crate) fn open(path: &std::path::Path) -> std::io::Result<Self> {
        cap_std::fs::Dir::open_ambient_dir(path, cap_std::ambient_authority()).map(Self)
    }

    pub(crate) fn remove(self) -> std::io::Result<()> {
        self.0.remove_open_dir_all()
    }
}