Home
last modified time | relevance | path

Searched refs:get_or_try_init (Results 1 - 5 of 5) sorted by relevance

/third_party/rust/crates/once_cell/src/
H A Drace.rs77 match self.get_or_try_init(|| Ok::<NonZeroUsize, Void>(f())) { in get_or_init()
90 pub fn get_or_try_init<F, E>(&self, f: F) -> Result<NonZeroUsize, E> in get_or_try_init() functions
159 pub fn get_or_try_init<F, E>(&self, f: F) -> Result<bool, E> in get_or_try_init() functions
163 self.inner.get_or_try_init(|| f().map(OnceBool::to_usize)).map(OnceBool::from_usize) in get_or_try_init()
240 pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&'a T, E> in get_or_try_init() functions
245 let ptr = self.inner.get_or_try_init(f)?; in get_or_try_init()
349 match self.get_or_try_init(|| Ok::<Box<T>, Void>(f())) { in get_or_init()
362 pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> in get_or_try_init() functions
H A Dlib.rs137 //! let cfg = self.config.get_or_try_init(|| {
561 match self.get_or_try_init(|| Ok::<T, Void>(f())) { in get_or_init()
584 /// assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));
586 /// let value = cell.get_or_try_init(|| -> Result<i32, ()> {
592 pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> in get_or_try_init() functions
1085 match self.get_or_try_init(|| Ok::<T, Void>(f())) { in get_or_init()
1109 /// assert_eq!(cell.get_or_try_init(|| Err(())), Err(()));
1111 /// let value = cell.get_or_try_init(|| -> Result<i32, ()> {
1117 pub fn get_or_try_init<F, E>(&self, f: F) -> Result<&T, E> in get_or_try_init() functions
H A Dimp_cs.rs11 // interior mutability and to be able to re-use `get_or_try_init`.
50 cell.get_or_try_init(f).map(|_| {
/third_party/rust/crates/rustix/src/io/
H A Dprocfs.rs219 PROC.get_or_try_init(|| { in proc()
244 .get_or_try_init(|| { in proc_self()
275 .get_or_try_init(|| {
312 .get_or_try_init(|| { in proc_self_fdinfo()
/third_party/rust/crates/once_cell/tests/
H A Dit.rs345 fn get_or_try_init() { in get_or_try_init() functions
350 std::panic::catch_unwind(|| cell.get_or_try_init(|| -> Result<_, ()> { panic!() })); in get_or_try_init()
354 assert_eq!(cell.get_or_try_init(|| Err(())), Err(())); in get_or_try_init()
357 cell.get_or_try_init(|| Ok::<_, ()>("hello".to_string())), in get_or_try_init()

Completed in 7 milliseconds