Lines Matching defs:OnceCell
15 pub(crate) struct OnceCell<T> {
30 // Thread A creates a `OnceCell` and shares it with
34 unsafe impl<T: Sync + Send> Sync for OnceCell<T> {}
35 unsafe impl<T: Send> Send for OnceCell<T> {}
37 impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceCell<T> {}
38 impl<T: UnwindSafe> UnwindSafe for OnceCell<T> {}
40 impl<T> OnceCell<T> {
41 pub(crate) const fn new() -> OnceCell<T> {
42 OnceCell {
49 pub(crate) const fn with_value(value: T) -> OnceCell<T> {
50 OnceCell {
122 /// Consumes this `OnceCell`, returning the wrapped value.
133 // Three states that a OnceCell can be in, encoded into the lower bits of `queue` in
134 // the OnceCell structure.
305 use super::OnceCell;
307 impl<T> OnceCell<T> {
316 static O: OnceCell<()> = OnceCell::new();
326 static O: OnceCell<()> = OnceCell::new();
362 static O: OnceCell<()> = OnceCell::new();
383 static O: OnceCell<()> = OnceCell::new();
423 assert_eq!(size_of::<OnceCell<u32>>(), 4 * size_of::<u32>());