Home
last modified time | relevance | path

Searched refs:ScopeGuard (Results 1 – 3 of 3) sorted by relevance

/openbmc/linux/rust/kernel/
H A Dtypes.rs156 pub struct ScopeGuard<T, F: FnOnce(T)>(Option<(T, F)>); struct
158 impl<T, F: FnOnce(T)> ScopeGuard<T, F> { impl
173 impl ScopeGuard<(), fn(())> { implementation
175 pub fn new(cleanup: impl FnOnce()) -> ScopeGuard<(), impl FnOnce(())> { in new() argument
176 ScopeGuard::new_with_data((), move |_| cleanup()) in new()
180 impl<T, F: FnOnce(T)> Deref for ScopeGuard<T, F> { implementation
189 impl<T, F: FnOnce(T)> DerefMut for ScopeGuard<T, F> { implementation
196 impl<T, F: FnOnce(T)> Drop for ScopeGuard<T, F> { implementation
H A Dinit.rs215 types::{Opaque, ScopeGuard},
1029 let mut init_count = ScopeGuard::new_with_data(0, |i| {
1073 let mut init_count = ScopeGuard::new_with_data(0, |i| {
/openbmc/linux/rust/kernel/sync/
H A Dlock.rs9 use crate::{bindings, init::PinInit, pin_init, str::CStr, types::Opaque, types::ScopeGuard};
149 ScopeGuard::new(|| unsafe { B::relock(self.lock.state.get(), &mut self.state) }); in do_unlocked()