Struct winsafe::guard::UnlockFileGuard
source · pub struct UnlockFileGuard<'a, H>where
H: kernel_Hfile,{ /* private fields */ }
Available on crate feature
kernel
only.Expand description
RAII implementation for the HFILE
lock which automatically
calls
UnlockFile
when the object goes out of scope.
Implementations§
source§impl<'a, H> UnlockFileGuard<'a, H>where
H: kernel_Hfile,
impl<'a, H> UnlockFileGuard<'a, H>where
H: kernel_Hfile,
sourcepub const unsafe fn new(
hfile: &'a H,
offset: u64,
num_bytes_to_lock: u64
) -> Self
pub const unsafe fn new( hfile: &'a H, offset: u64, num_bytes_to_lock: u64 ) -> Self
Constructs the guard by taking ownership of the objects.
§Safety
Be sure the handle must be freed with
UnlockFile
at the end of scope.
sourcepub const fn num_bytes_to_lock(&self) -> u64
pub const fn num_bytes_to_lock(&self) -> u64
Returns the number of locked bytes.
Trait Implementations§
source§impl<'a, H> Drop for UnlockFileGuard<'a, H>where
H: kernel_Hfile,
impl<'a, H> Drop for UnlockFileGuard<'a, H>where
H: kernel_Hfile,
Auto Trait Implementations§
impl<'a, H> Freeze for UnlockFileGuard<'a, H>
impl<'a, H> RefUnwindSafe for UnlockFileGuard<'a, H>where
H: RefUnwindSafe,
impl<'a, H> Send for UnlockFileGuard<'a, H>where
H: Sync,
impl<'a, H> Sync for UnlockFileGuard<'a, H>where
H: Sync,
impl<'a, H> Unpin for UnlockFileGuard<'a, H>
impl<'a, H> UnwindSafe for UnlockFileGuard<'a, H>where
H: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more