Expand description
Block-device traits.
Two layers because not every consumer needs writes:
BlockReadis the minimum: positioned reads + size. Disk-image readers (qcow2 reading) and probes (partition table walk) only need this much.BlockDeviceextendsBlockReadwith optionalwrite_at/flush/is_writable/set_len/can_grow. Read-only devices that opt into the larger trait inherit the defaultErr(ReadOnly)write path automatically, and every device that cannot change its own length inherits the same refusal forset_len.
Both traits are Send + Sync so callers can hold them behind Arc<dyn _>
across thread boundaries.
Traits§
- Block
Device - Read-write random-access block device. Implementors that genuinely
support writes override
write_at/flush/is_writable. The defaults model a strict read-only device. - Block
Read - Read-only random-access block device.