Lines Matching refs:Cfg
6 pub struct Cfg<'a> { struct
236 pub static mut CFG: Cfg = Cfg {
244 impl<'a> Debug for Cfg<'a> { implementation
264 pub use self::r#impl::Cfg::CFG;
319 static CONST_DEREFS: RefCell<Map<Handle, Box<super::Cfg<'static>>>> = RefCell::default();
323 struct Handle(*const Cfg<'static>);
325 impl<'a> Cfg<'a> { implementation
326 fn current() -> super::Cfg<'a> { in current()
332 super::Cfg { in current()
341 const fn handle(self: &Cfg<'a>) -> Handle { in handle()
342 Handle(<*const Cfg>::cast(self)) in handle() constant
348 pub enum Cfg<'a> { enum
349 Mut(super::Cfg<'a>),
353 impl<'a> Debug for Cfg<'a> { implementation
355 if let Cfg::Mut(cfg) = self { in fmt()
358 Debug::fmt(&Cfg::current(), formatter) in fmt()
363 impl<'a> Deref for Cfg<'a> { implementation
364 type Target = super::Cfg<'a>;
367 if let Cfg::Mut(cfg) = self { in deref()
370 let cfg = CONST_DEREFS.with(|derefs| -> *mut super::Cfg { in deref()
374 .or_insert_with(|| Box::new(Cfg::current())) in deref()
381 impl<'a> DerefMut for Cfg<'a> { implementation
383 if let Cfg::CFG = self { in deref_mut()
385 *self = Cfg::Mut(Cfg::current()); in deref_mut()
388 Cfg::Mut(cfg) => cfg, in deref_mut()
389 Cfg::CFG => unreachable!(), in deref_mut()
394 impl<'a> Drop for Cfg<'a> { implementation
396 if let Cfg::Mut(cfg) = self { in drop()