! / 0 0 0 0 8 ` // 68 ` memoffset-735a9caf36edca0d.memoffset.c1dbe362ab876bd3-cgu.0.rcgu.o/ lib.rmeta/ 0 0 0 644 33760 ` ELF>`@@GNUrust#rustc 1.72.0 (5680fa18f 2023-08-23)ՆQ4-46a989d0e2cef827e$ɛDp>-b114db70ea0690b1rustc_std_workspace_core ūu sR-13da980d6c74fec5U doc_comment  _memoffset__addr_of      raw_ref_macros     _memoffset__field_check  allow_clippy   _memoffset__field_check_tuple    _memoffset__field_check_union"""""" " " ""_memoffset__let_base_ptr   _memoffset_offset_from_unsafeunstable_const   stable_const  -2:_memoffset__offset_of_implunstable_offset_of & _memoffset__offset_of_union_impl0 ////  ///&tests7777 777  .... ... __privsize_of_pointee raw_field       raw_field_tuple raw_field_union offset_of_tuple offset_of_unionspan_of_memoffset__compile_error  V _ptrV       (  .7  $ ( , 6 H A crate used for calculating offsets of struct members and their spans.K m This functionality currently can not be used in compile time code such as `const` or `const fn` definitions. p  ## Examples  ``` % use memoffset::{offset_of, span_of}; (  #[repr(C, packed)] * struct HelpMeIAmTrappedInAStructFactory { -$ help_me_before_they_: [u8; 15], ' a: u32  }   fn main() { E assert_eq!(offset_of!(HelpMeIAmTrappedInAStructFactory, a), 15); HG assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, a), 15..19); J^ assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, help_me_before_they_ .. a), 0..15); a   J This functionality can be useful, for example, for checksum calculations: M ```ignore  struct Message { header: MessageHeader, fragment_index: u32, fragment_count: u32, payload: [u8; 1024], checksum: u16@ let checksum_range = &raw[span_of!(Message, header..checksum)];C& let checksum = crc16(checksum_range);)        (  .7  $ ( , 6 4 Hidden module for things the macros need to access.7  mem    2[ Use type inference to obtain the size of the pointee (without actually using the pointer).^     )   > `addr_of!`, or just ref-then-cast when that is not available.A  +       ,   -                                 addr_of        $! Deref-coercion protection macro. $ G Prevents complilation if the specified field name is not a part of the J struct definition.  ```compile_fail( use memoffset::_memoffset__field_check;+ struct Foo { foo: i32, type BoxedFoo = Box;) _memoffset__field_check!(BoxedFoo, foo);,/    01   "       unneeded_field_pattern  "  *($< Prevents complilation if the specified type is not a tuple.?). use memoffset::_memoffset__field_check_tuple;1( _memoffset__field_check_tuple!(i32, 0);+3    45   "        unneeded_wildcard_pattern   "*, Deref-coercion protection macro for unions./H Unfortunately accepts single-field structs as well, which is not ideal,K but ultimately pretty harmless.#). use memoffset::_memoffset__field_check_union;1 union Foo { variant_a: i32,*5 _memoffset__field_check_union!(BoxedFoo, variant_a);87    89 "  "    "           4 !!! !!! unused_unsafe!  #!!" "" """"" "" """(J Computes a const raw pointer to the given field of the given base pointer&M to the given parent type.&'A The `base` pointer *must not* be dangling, but it *may* point to'D uninitialized memory.'' ' ;(( ('#( (,((( base(( ((( parent(( ((( ((  (((,(, ( )))) A))) )) ) @))) @))+++ +++ <+  #++, + ,,,,, ,,, @, , , ,, A,,, ,,.>,M! to the given parent tuple typle.-$-?-D?-..=.. tuple_ty... . >.. ..#..2./. @.. ... A..  .// //  ///2/2 / //// A/// // / @/// @//111 111 <1  #222 2 22222 222 @2 2 2 22 A222 227>2MF3$3?3D?44 ## Note4 X This macro is the same as `raw_field`, except for a different Deref-coercion check that4[ supports unions.5f Due to macro_rules limitations, this check will accept structs with a single field as well as unions.5iM This is not a stable guarantee, and future versions of this crate might fail6P? on any use of this macro with a struct, without a semver bump.7B7 7 @77 77#78<888 @88 888 A88 888 88  888<8< 8 8888 A888 88 8 @899 @99::: ::: <:  #;;< ; ;;;;; ;;; @; ; ; ;; A;;; ;<   B   %Q Macro to create a local `base_ptr` raw pointer of the given type, avoiding UB asT much as is possible currently. "  D       E   F                   "       "   uninit          !   MaybeUninit     "    Z                "   Z        *4 Macro to compute the distance between two pointers.7H      5  IJ     @      @ @ #       offset_from  @        'L   +  M #N   A       base_ptr A  field_ptr      g A    g  g$Q Calculates the offset of the specified field from the start of the named struct.T use memoffset::offset_of;* a: u32, b: u64, c: [u8; 5]' assert_eq!(offset_of!(Foo, a), 0);*' assert_eq!(offset_of!(Foo, b), 4); *    ## Notes B Rust's ABI is unstable, and [type layout can be changed with each ED compilation](https://doc.rust-lang.org/reference/type-layout.html).!G!T Using `offset_of!` with a `repr(Rust)` struct will return the correct offset of the!WO specified `field` for a particular compilation, but the exact value may change"RS based on the compiler version, concrete struct type, time of day, or rustc's mood.#V#W As a result, the value should not be retained and used between different compilations.#Z$ $ P$$ $$#$ %%%% % A%% %%% %%  %%%%  % %%%% A%%% %%(J Calculates the offset of the specified field from the start of the tuple.%M&&& use memoffset::offset_of_tuple;&#&&Y assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout");'\''''R'( F''( ( S(( ((#((+(( ( A((  ((( ((  (((+(+ ) ))) g))) A)) * g* *  * *** g*** A*** ** * +++ g+ + g++,-++U++ +++ ++ ++++ + V+, ++#,,W,, ,,, ,/,, , A,, ,,, ,,  ,,,/,/ - --- g--- A-- . g. . . ... g... A... .. . /// g/ / g//6Q Calculates the offset of the specified union member from the start of the union.1T222 use memoffset::offset_of_union;2#2282 foo32: i32,3 foo64: i64,33330 assert!(offset_of_union!(Foo, foo64) == 0);33444M4 f Due to macro_rules limitations, this macro will accept structs with a single field as well as unions.4iO5PP5B6 6 Y66 66#66766 6 A66 666 66  667777  7  7777 A777 77   [  &' Reexport for `local_inner_macros`; see*o . r  ]       ^           inner                      V Produces a range instance representing the sub-slice containing the specified member. Y : This macro provides 2 forms of differing functionalities. = I The first form is identical to the appearance of the `offset_of!` macro. L   span_of!(Struct, member)   b The second form of `span_of!` returns a sub-slice which starts at one field, and ends at another. e% The general pattern of this form is:(  // Exclusive' span_of!(Struct, member_a .. member_b)* // Inclusive( span_of!(Struct, member_a ..= member_b)+ // Open-ended ranges span_of!(Struct, .. end) span_of!(Struct, start ..) ### Note \ This macro uses recursion in order to resolve the range expressions, so there is a limit to_" the complexity of the expression.%N In order to raise the limit, the compiler's recursion limit should be lifted.Q ### Safety[ The inter-field form mentioned above assumes that the first field is positioned before the^ second. / This is only guarenteed for `repr(C)` structs.2Z Usage with `repr(Rust)` structs may yield unexpected results, like downward-going ranges,]e spans that include unexpected fields, empty spans, or spans that include *unexpected* padding bytes.h use memoffset::span_of; #[repr(C)] struct Florp { struct Blarg { x: [u32; 2], y: [u8; 56], z: Florp, egg: [[u8; 4]; 4]- assert_eq!(0..84, span_of!(Blarg, ..));0/ assert_eq!(0..8, span_of!(Blarg, .. y));20 assert_eq!(0..64, span_of!(Blarg, ..= y));3, assert_eq!(0..8, span_of!(Blarg, x));// assert_eq!(8..84, span_of!(Blarg, y ..));21 assert_eq!(0..8, span_of!(Blarg, x .. y));42 assert_eq!(0..64, span_of!(Blarg, x ..= y));5  ` #.4  helper root   Expected a range, found '..='      Expected a range, found '..'     A                     A            A                     A                        A           !            A    !!! begin!!  !!!!! !!  !!!"!" ! !!  !  !!!! !!! A!!! !! ! !!  !  !!"! !!" A""" """" " "  "" " "  " "" ""  ""  """ """# " "" "" ""# A## #### ##  ##### ##  ###$#$#$  #  #### ### A### # #  ##  #  ##$# ##$ A$$$ $ $  $$$$ $ $$ $$ $$$ A$$ $$$$ $$  $$$$$%&%&%%  %  %%%% %%% A%%% % %  %%% % %  % %% %%  %%  %%%% %&&& & && && &&& A&& &&&& &&  &&&&&&'&' & &&'QFound inclusive range to the end of a struct. Did you mean '..' instead of '..='?&S''( ' '' '' '(( A(( (((( ((  ((((()() ( ((  (  (((( ((( A((( ((() ( (  (( ( (  ) )) ))  ))  ))) )))* ) )) )) ))) A)) ))))))) ))  ) ****  **  ***** rest**  * ****** * *** * ** *** A******* * ***  ******* * ***+ * ** *+ +++ A++ +++++  ++  +++++ ++  + ++++++ + +++ + ++ +++ A++++  +++++++ + ++,,,  ,, ,,,,,, exp,,  , ,,,.,. , ,,, ,,,  ,, - @-- - -  -- --- -- -- - --- - - ---  -------- - -- - - @-- - - @..4https://doc.rust-lang.org/reference/type-layout.htmlkb5 kbEمkbHLV_ kb4v5kb:n#Kkb7Z@kb So,YkbD-0G-kb5!§kbzbl8kbB Cb kbxkb!Lkbmv kbVOԪpkbTP`/kbMuj\|kb\d1qkbO&SmkbD[Ym^kb_CɑǾkbH]Rikb~ukbW[`kb_LNʀkbCIEkbq˶iUkb {y(l %  "k& 6+d+.14: =@C*D"F@^+$D %%%%%%%%%%%%%%%%fQO #(\+,/29;>B"D5EwOe "e&0+^+.14:=@C$DFw `yKI #(V+|,/29;>BD/EqO}/0T+Dux|")07>T[qgRP #(,/29;>B6ExOskkbjKb@tPtHtXtytitt ODHT @kbEمkbHLV_ kb4v5kbTP`/kbCIEkb5 kb_CɑǾkb So,Ykb!L kbB Cb kbD-0G-kb5!§kbD[Ym^kbH]RikbMuj\|kbzbl8 kbO&SmkbVOԪpkb\d1qkbq˶iUkbmv kb:n#Kkb~ukbx kb_LNʀkb {y(kbW[`kb7Z@Bv_h,&E/4>68N %zz@[GBv_h]/home/steffen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/memoffset-0.9.0/src/lib.rs rN. 0T^#PQPMI<R3NLOJQQ Lq).(IKbND* 8#FO 8c9   ~;Bc/home/steffen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/memoffset-0.9.0/src/raw_field.rs ?_U?"OzT.PQPMI<R3NLOJQQ B#-#[C%K,-'!IK1%'!IK%%@2,-24-20L$29-!IK4X % -!IKX % NE$03G"R,QE N%E$.9G"R,QE N%E \jQC$09G"R,QE &7ϳeSR$ޔic/home/steffen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/memoffset-0.9.0/src/offset_of.rs SBU=ZTT#PQPMI<R3NLOJQQ U#(!@EDB%J3(!KPN86-$JGPdP;-#-,$*$N6?<'&*$9U++ FHXSW[$#5N$]$"N6E<,$0$N6E<'$&0$9U$4 jQC$$;  +++ C  +++ ++ U 111  0 !!/& ( %$'.0    $LLL $$%0J 0J 0J   $RRR$(  6' )& 6$( & -*\[ҿL5a/home/steffen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/memoffset-0.9.0/src/span_of.rs >eg:#PQPMI<R3NLOJQQ +s)&Z>Mf)+, `&R_ 3^i1340356$(D&C$5B>4N=D)J84NI64"A6BB$a>8RVHF<#/"F   ,,0 C ,,0   $.0G23   /0/10123C!8 !8 !8 #: "5 #R .8tJ5j(9+z%{|~x86_64-unknown-linux-gnu^Bt`񊠂70V memoffset-735a9caf36edca0dkb ((pppppp$$$$ @ @ $ $ @@hhppppHH ] .note.gnu.property.shstrtab.strtab.symtab.rmeta@ .`&()5/0 0 0 0 644 584 ` ELF>@@6.text.debug_aranges.note.GNU-stack.strtab.symtabmemoffset.c1dbe362ab876bd3-cgu.0&pW@@@.@0