From 5d50d646715b9447ab39c61d8a21ced3a857fb2d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 12 Mar 2026 20:35:13 +0100 Subject: [PATCH] block: disk_file: Add DiskFile supertrait Bundles DiskSize and Geometry as the universal disk capabilities every format must implement. Adds Sync so that Arc can be shared across threads for concurrent readonly access. Signed-off-by: Anatol Belski --- block/src/disk_file.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/src/disk_file.rs b/block/src/disk_file.rs index 69a1152c8..632b370e7 100644 --- a/block/src/disk_file.rs +++ b/block/src/disk_file.rs @@ -90,3 +90,10 @@ pub trait Resizable: Send + Debug { /// Resizes the disk image to the given size in bytes, if the backend supports it. fn resize(&mut self, size: u64) -> BlockResult<()>; } + +/// Supertrait bundling universal disk capabilities. +/// +/// Every disk format implements `DiskSize` and `Geometry`. +/// `Sync` is required so that `Arc` can be shared +/// across threads for concurrent readonly access. +pub trait DiskFile: DiskSize + Geometry + Sync {}