Searched refs:ScopeGuard (Results 1 – 1 of 1) sorted by relevance
/linux-6.3-rc2/rust/kernel/ |
A D | types.rs | 47 unsafe fn borrow_mut(ptr: *const core::ffi::c_void) -> ScopeGuard<Self, fn(Self)> { in borrow_mut() 50 ScopeGuard::new_with_data(unsafe { Self::from_foreign(ptr) }, |d| { in borrow_mut() 171 pub struct ScopeGuard<T, F: FnOnce(T)>(Option<(T, F)>); struct 173 impl<T, F: FnOnce(T)> ScopeGuard<T, F> { impls 188 impl ScopeGuard<(), fn(())> { implementation 190 pub fn new(cleanup: impl FnOnce()) -> ScopeGuard<(), impl FnOnce(())> { in new() argument 191 ScopeGuard::new_with_data((), move |_| cleanup()) in new() 195 impl<T, F: FnOnce(T)> Deref for ScopeGuard<T, F> { implementation 204 impl<T, F: FnOnce(T)> DerefMut for ScopeGuard<T, F> { implementation 211 impl<T, F: FnOnce(T)> Drop for ScopeGuard<T, F> { implementation
|
Completed in 3 milliseconds