pub struct BlockPointsToReadGuard<'a, M: MetaData> {
b: Option<SpinLockGuard<'a, [u8; 4096]>>,
_m: PhantomData<M>,
}Expand description
A read-only guard that provides typed access to a metadata block.
BlockPointsToReadGuard is returned by BlockPointsTo::read and allows
immutable access to the contents of a 4096-byte disk block as a value of
type M, which implements the MetaData trait.
Internally, it wraps a locked reference to the block’s byte array using a
SpinLockGuard and casts it to the metadata type using unsafe pointer
casting. The guard ensures that the block cannot be modified while borrowed
immutably.
§Use Case
Use this when you want to inspect metadata structures (like an inode table, superblock, or bitmap) without modifying them.
Fields§
§b: Option<SpinLockGuard<'a, [u8; 4096]>>Spinlock guard for the raw block data.
_m: PhantomData<M>Marker to associate the block with its metadata type.
Trait Implementations§
Source§impl<M: MetaData> Deref for BlockPointsToReadGuard<'_, M>
impl<M: MetaData> Deref for BlockPointsToReadGuard<'_, M>
Auto Trait Implementations§
impl<'a, M> Freeze for BlockPointsToReadGuard<'a, M>
impl<'a, M> !RefUnwindSafe for BlockPointsToReadGuard<'a, M>
impl<'a, M> !Send for BlockPointsToReadGuard<'a, M>
impl<'a, M> Sync for BlockPointsToReadGuard<'a, M>where
M: Sync,
impl<'a, M> Unpin for BlockPointsToReadGuard<'a, M>where
M: Unpin,
impl<'a, M> !UnwindSafe for BlockPointsToReadGuard<'a, M>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more