rustRy rustc 1.48.0coreƞ-3375e4f89d420e7acompiler_builtins-f74b197469e67088rustc_std_workspace_core扪ڹ8-5e0675f526ef5c6bstd؝-6bf3f16f340782caallocץޯČ-1ebf406bd4ea5769libcɄ-dfbef8c525de0186unwindܽ݇!-bd645b20c6c7b56dcfg_ifшC-b9e1e523c0c29a77 hashbrownǰ-c6632ca171f954ddrustc_std_workspace_allocW-b5bfd0198c7b740drustc_demangleة-3ac2d0878c297d42 addr2lineƄ-12740563628e601fgimlin-0ac82a1e1820dd21object»-af517d7f13e7c960 miniz_oxide֕㵤 -a2ba33c985785afeadler˯-3f6e9f8f4afbea6d panic_unwindի-13f3099d50c21bc6¾QF}-`%j|Acore6ĺ_compiler_builtins†A?lazyCp4W tcoreikm/stdl^~)hhsV`H}tlh$u yXji/˞Ibw`tb#:AoJ0!¦ӵiLazyQaJJR8 0+INIT­(d]getbG:ؽwFB$lΒKҾb,q(?z/Xcɱ-WF[^~@Tl2Q)x1__lazy_static_createB8)Il $ xW0ʐNY%Dd__lazy_static_internalxipZ=b lazy_staticxB(ۮjFȍN LazyStatic%Ai9VVVA`&;% initializeZ1A|l9¯ initialize ]JdT+7Dp]Ʌ^XHdz :ˡ͏l*{  Ϫv5K[zw 3/.L$+7 {Knߓ?V#=d _4y-  A7;DnKk o$&I0/GrvVƷt:O]RI%=O> | corecompiler_builtins__lazy_static_create==__Deref__lazy_static_internal lazy_static% %. A macro for declaring lazily evaluated statics. Using this macro, it is possible to have `static`s that require code to be executed at runtime in order to be initialized. This includes anything requiring heap allocations, like vectors or hash maps, as well as anything that requires function calls to be computed. # Syntax ```ignore lazy_static! { [pub] static ref NAME_1: TYPE_1 = EXPR_1; [pub] static ref NAME_2: TYPE_2 = EXPR_2; ... [pub] static ref NAME_N: TYPE_N = EXPR_N; } ``` Attributes (including doc comments) are supported as well: ```rust # #[macro_use] # extern crate lazy_static; # fn main() { lazy_static! { /// This is an example for using doc comment attributes static ref EXAMPLE: u8 = 42; } # } ``` # Semantics For a given `static ref NAME: TYPE = EXPR;`, the macro generates a unique type that implements `Deref` and stores it in a static with name `NAME`. (Attributes end up attaching to this type.) On first deref, `EXPR` gets evaluated and stored internally, such that all further derefs can return a reference to the same object. Note that this can lead to deadlocks if you have multiple lazy statics that depend on each other in their initialization. Apart from the lazy initialization, the resulting "static ref" variables have generally the same properties as regular "static" variables: - Any type in them needs to fulfill the `Sync` trait. - If the type has a destructor, then it will not run when the process exits. # Example Using the macro: ```rust #[macro_use] extern crate lazy_static; use std::collections::HashMap; lazy_static! { static ref HASHMAP: HashMap = { let mut m = HashMap::new(); m.insert(0, "foo"); m.insert(1, "bar"); m.insert(2, "baz"); m }; static ref COUNT: usize = HASHMAP.len(); static ref NUMBER: u32 = times_two(21); } fn times_two(n: u32) -> u32 { n * 2 } fn main() { println!("The map has {} entries.", *COUNT); println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); println!("A expensive calculation on a static results in: {}.", *NUMBER); } ``` # Implementation details The `Deref` implementation uses a hidden static variable that is guarded by an atomic check on each access. # Cargo features This crate provides one cargo feature: - `spin_no_std`: This allows using this crate in a no-std environment, by depending on the standalone `spin` crate. doc html_root_url !https://docs.rs/lazy_static/1.4.0#<no_std core44std44Cell44unreachable_unchecked5 4&Once5)5 ONCE_INIT5 )5Sendߘ4Sized4Sync4Unpin4Dropϙ4Fnՙ4FnMutٙ4FnOnce4dropך  4AsMutכ4AsRefޛ4From4Into4DoubleEndedIteratorȜ(4ExactSizeIteratorݜ(4Extendǝ(4 IntoIteratorϝ (4Iteratorݝ)4Option4NoneΞ4NoneΞ4SomeԞ4SomeԞ4Result4Err4Err4OkƟ4OkƟ4asm"4assert!4cfg4column4 compile_error 4concat4 concat_idents 4env4file4 format_args 4format_args_nlΡ4 global_asmޡ $4include 4 include_bytes 4 include_str 4line4llvm_asm#4 log_syntax %4 module_path 4 option_env 4 stringifyȢ 4 trace_macrosӢ &4bench(4global_allocator*4test'4 test_case )4Clone 4Clone 4Copy4Copy4Debug34Default4Default4Eq 4Eq 4Hash44Ordť 4Ordť 4 PartialEqΥ  4 PartialEqΥ  4 PartialOrd٥ 4 PartialOrd٥ 4RustcDecodable,4RustcEncodable-4cfg_accessible+4ToOwned4BoxU4Stringȫ)4ToStringЫ4Vec#4T cfg not feature spin_no_std $pathinline_lazy.rsdoc hidden  66 60 TT9696669  66)   60 99:9  60960:6060960960:6060 669T9696 Lazy(Cell::new(None), ONCE_INIT) 787allow7O77 deprecated7 77977777  977 97 :7 :)7878979797787 :)self8f877inline7^77 always778 9F 9? 9F?8?8 ??98 8C88:81818181  981?98C8 )9? ??@?8<999:::9:: 9:::  :  F F  .;D Battempted to derefence an uninitialized lazy static. This is a bugBBBF ::Some9<<7::  9:@8 ?8?8C :8A81@81: 9:: 9:B: self8 f8x:7 <<(99T9<9<, ,KI Support trait for enabling a few common operation on lazy static values.*L+5 This is implemented by each defined lazy static, and+8* used by the free functions in this crate.+-Selflazy, ,,doc,,, hidden,,, Self I?, 10 lazy1 0*: Takes a shared reference to a lazy static and initializes,= it if it has not been already.-"-G This can be used to control the initialization point of a lazy static.-J. Example:. . ```rust.  #[macro_use]. extern crate lazy_static;.. lazy_static! {.5 static ref BUFFER: Vec = (0..255).collect();.8 }// fn main() {/& lazy_static::initialize(&BUFFER);/)/ // .../) work_with_initialized_data(&BUFFER);0, }0- # fn work_with_initialized_data(_: &[u8]) {}00 ```0 9 9?T  19191 11111 91111%1%?10P?1D1?1D1lazy10P 8819???888@99 999?999 ??9999 Some99 989 999998.8.?981?8A81?8E899 99?9?9self8 @f8?81=>== = NAME== ident=== T== ty===> static== NAME=== crate== lazy=> Lazy>>> T>>>> crate>> lazy>> Lazy>> INIT>>>=<  macro_export< <=doc=== hidden===% attr meta  vis tt  static ref N ident T ty e expr t tt  __lazy_static_internal   MAKE TY attr  vis  N __lazy_static_internal   TAIL N T e lazy_static  t   TAIL N ident T ty e expr" impl crate __Deref for N  type Target T fn deref  self  T  inline always fn __static_ref_initialize T e inline always fn __stability  !'static T  __lazy_static_create  LAZY T LAZY   get    __static_ref_initialize  __stability    impl   crate ! LazyStatic! for!! N!!! fn! initialize! !! lazy!! ! Self!!! let! _!! ! ! ! lazy!!""" " MAKE" TY""""""""" attr"" meta" """""""" vis"" tt" """ N"" ident"""% ### allow### missing_copy_implementations#### allow### non_camel_case_types#### allow### dead_code# ##$##$# attr# $$$$$ vis$ $ struct$$ N$$$ __private_field$$$$$$$ doc$$$ hidden$$$$$ vis$ $ static$$ N$$$ N$$$ N$$% __private_field$%%%%%%%%%%   macro_export  local_inner_macros#doc hidden%*%&%%%%%%% attr%% meta% % static% ref%& N&& ident&&& T&& ty&&& e&& expr&&&&&& t&& tt& &&&' __lazy_static_internal' '''''''''' attr' ''' static' ref'' N''' T''' e'''''' t' ''''(''''''' attr'' meta' ' pub' static' ref'' N'' ident'(( T(( ty((( e(( expr(((((( t(( tt( ((() __lazy_static_internal( (((((((((( attr( ((( pub( static( ref(( N((( T((( e(((((( t( (()))))))))) attr)) meta) ) pub))))))) vis)) tt) ) static) ref)) N)) ident))) T)) ty))) e)) expr)))))) t)) tt) )))* __lazy_static_internal) ********** attr* *** pub******* vis* * static* ref** N*** T*** e****** t* ********%%  macro_export% %% local_inner_macros%%#% zT}H<(("",D:D"#g$M$|U~J=(("" ,G:D"#i$N$}XM>((""!,H:D"#j$O$]C#",:XD"$T$ ]S ("',N: D"#o$ S"#bU( ("!$&4_(-$&" D;$ '!qWFg("#<$ '4yj["#I$#'#(:';"*(*C\t1G[q3^~-AUi}3Ldx !7Kaz#Nn 1EYmcratecrate  coreprelude_importpanic t F core_panicconst_caller_location core$crate::assertt! core debug_assert;[tuNNOO OO#OOOAOW/home/seth/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs(h@.1,FNME0K0NA  ...;#K  9*-1-"ɸy_/home/seth/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs]Uu$L oDD41>91,FNME,$F1=- # =6%"p, )$I੿°̩ lazy_staticx86_64-unknown-linux-gnu-567e3c296460ef14ؗȊdC?Wq^2;[:>Ϥ {`hx,,