Expand description
Pure-Rust block-device framework. The shared substrate every filesystem driver and disk-image reader plugs into.
See the crate-level
README for the
intended consumers and design.
Re-exports§
pub use block::BlockDevice;pub use block::BlockRead;pub use caching_device::CachingDevice;pub use callback_device::CallbackDevice;pub use callback_device::FlushCb;pub use callback_device::ReadCb;pub use callback_device::WriteCb;pub use error::Error;pub use error::Result;pub use file_device::FileDevice;pub use readonly::ReadOnlyDevice;pub use slice::OwnedRwSlice;pub use slice::OwnedSlice;pub use slice::SliceReader;pub use stream::BlockReadStreamer;
Modules§
- block
- Block-device traits.
- caching_
device - Small LRU read-cache decorator. Caches only block-aligned, block-sized reads; everything else passes through. Writes invalidate any overlapping cached entries.
- callback_
device BlockDevicebacked by host-process-owned callbacks. Used when the caller already holds the underlying resource (an FSKitFSBlockDeviceResource, a Go file handle, a C-side fd) and the Rust side just needs a trait surface to feed into a driver.- error
- Unified error type. Each driver still keeps its own rich error type for internal use; conversions to/from this one happen at the trait boundary.
- ffi
- C ABI for the block-device framework.
- file_
device - File-backed
BlockDevice. Used for disk images, raw/dev/diskNreads, anything that std::fs::File can address. - readonly
- Read-only safety wrapper.
- slice
- Slice adapters — view a byte sub-range of any
BlockReadas its own device. Useful any time you want to feed a fragment of a larger device to a consumer that expects a whole block source — partition probes, image-file extents, mmap-style views, fuzzer harnesses. - stream
std::io::Read+std::io::Seekadapter over anyBlockRead.