Files
boc/aamos-ledger-rust/target/debug/deps/libyoke-f8bf9e5b8bbb2034.rmeta
T

330 lines
183 KiB
Plaintext
Raw Normal View History

rust
ôÚ#rustc 1.96.0 (ac68faa20 2026-05-25)ÁíàÄTËŸ ÜJîÄ)'ß\¥!-3d1337db07d0b3aeÁstable_deref_traitÁ½ÊTýö÷n˜TóQ-á†-771635b0451f799dÁ¤°ð ¾ä-±($²ï=©Ã-7e98a21bfd32b0edÁ yoke_deriveÁ×ã„Ô„ýT·+CIƒ•sÙ-ad663b8de2c8c776ÁzerofromÁ/ŽErÅÉŽV 7Í-92c585200eab8211Ázerofrom_deriveÁŸæþÇŽá2?M¥e (-abe85a41d9dcc735Á¤»¤Œ«BoxÁÄ»¤ŒžÆò»¤ŒÏK¡»¤Œüa$ÃtestsÁ, a$•aerasedÁ4œ»¤Œ€
ErasedArcCartÁlß»¤Œ·
ErasedBoxCartÁl$&€ ErasedRcCartÁdý»¤EG€øŒ»¤ŒæÆº»¤Œ—K黤ŒÄ×o»¤Œó×ToOwnedÁ< »¤ í cartable_ptrÁ sentinel_forÁ¥SENTINELÁprivateÁ SealedÁCartablePointerLikeÁRawÁinto_rawÁdrop_rawÁCloneableCartablePointerLikeÁ
addref_rawÁ'aÁ¥Ô¥ôþÔ¥¿!!Œ
!
from_cartableÁ!is_noneÁ&&ã))ƒ,.0eitherÁ22226C0Á6C1Á6¥6å6´;2=º =Ã =¥2Aº AÃ kinda_sorta_danglingÁDDDDDDDKindaSortaDanglingÁK¥KdangleÁDN¥Næ N
into_innerÁDR¥RåR´DV¥VDY¥Yã macro_implsÁ\\\\\copy_yoke_implÁ\impl_copy_typeÁ\unsafe_complex_yoke_implÁ\dÔd¥d'bÁd°\iÔiT1ÁiÍ iT2ÁiÍ i°\pÔp¥pÍ pŸp p°v utilsÁxxtransform_mut_yokeableÁzÔzªzz£zÍ yokeÁ 
YokeÁŒªŒÔŒŒyokeableÁŒcartÁªÔÔטª˜˜Ô˜Ô˜×žªžžÔžÔž¤ª¤¤Ô¤Ô©ª©©Ô©Ô©ï
¯ª¯¯Ô¯Ô¯µªµÔµµattach_to_cartÁ¹¹'deÁµtry_attach_to_cartÁ¼¼¼Òµattach_to_cart_badlyÁÀÒµtry_attach_to_cart_badlyÁÂÂÒŪÅÔÅÅgetÁÉÔÅ backing_cartÁÅinto_backing_cartÁÅ replace_cartÁÍC2ÁÍimpl FnOnce(C) -> C2ÁÅwith_mutÁÐÔÐÐÍ Åwith_mut_returnÁÔÔÔÔ£ÔÍ Åwrap_cart_in_optionÁÚªÚÔÚnew_always_ownedÁÚ
into_yokeableÁ ߪßÔßß new_ownedÁßtry_into_yokeableÁ
åªåÔåå convert_cart_into_option_pointerÁ êªêÔêêä
CloneableCartÁ ð¥
òÔò¥öªöÔööÔöƒüªüÔüü map_projectÁ¡ÔÔümap_project_clonedÁ'thisÁ¡ÔÔütry_map_projectÁ¡ÔÔütry_map_project_clonedÁº¡ÔÔü!map_project_with_explicit_captureÁ˜¡˜¥˜Ô˜Ôü(map_project_cloned_with_explicit_captureÁº¡¥ÔÔü%try_map_project_with_explicit_captureÁ£¡£¥££Ô£Ôü,try_map_project_cloned_with_explicit_captureÁ©º©¡©¥©©Ô©Ô°ª°Ô°°
map_with_cartÁ´¡´´Ô´Ô°map_with_cart_clonedÁ¹º¹¡¹¹Ô¹Ô°try_map_with_cartÁ¿¡¿¿¿Ô¿Ô°try_map_with_cart_clonedÁźšÅÅÅÔÅÔ̪ÌÔÌÌwrap_cart_in_either_aÁÐÌwrap_cart_in_either_bÁÒõ××YokeableÁÙÔÙ°Ù transformÁÙtransform_ownedÁÙmakeÁÙ
transform_mutÁßßÍ ×âÔâ¥â°â â® âÅ âÑ ééÍ ×ìÔì¥ì°ì ì® ìÅ ìÑ óóÍ  zero_fromÁööööööüªüüÔüÔüattach_to_zero_copy_cartÁ CartableOptionPointerÁinnerÁ _cartableÁ ×2
EitherCartÁº à 
ˆ
ˆ2º à ƒ2º à 2 º  Ã  2¤º ¤Ã ¤Ö2¨º ¨Ã ¨×\¬Ô¬°¬ ¬® ¬Å ¬Ñ ²²Í \µÔµ°µ µ® µÅ µÑ »»Í \¾Ô¾°¾ ¾® ¾Å ¾Ñ ÄÄÍ \ÇÔÇ°Ç Ç® ÇÅ ÇÑ ÍÍÍ \ÐÔаРЮ ÐÅ ÐÑ ÖÖÍ \ÙÔÙ°Ù Ù® ÙÅ ÙÑ ßßÍ \ âÔâ°â â® âÅ âÑ èèÍ \
ëÔë°ë ë® ëÅ ëÑ ññÍ \ ôÔô°ô ô® ôÅ ôÑ úúÍ \ ýÔý°ý ý® ýÅ ýÑ ƒƒÍ \
Ô° ® Å Ñ ŒŒÍ \Ô° ® Å Ñ Í \˜Ô˜°˜ ˜® ˜Å ˜Ñ žžÍ \¡Ô¡°¡ ¡® ¡Å ¡Ñ §§Í \ªÔª°ª ª® ªÅ ªÑ °°Í d d® dÅ dÑ Í i i® iÅ iÑ ¼¼Í p p® pÅ pÑ ÂÂÍ %
(
+
;
U
X
[






£
£
®
®
´
´
Ë
û



œ
£
£
§
«
«
«
¯
¸
Á
Ê
Ó
Ü
å
î
÷




¤
­
ïÙ  Ô¥¥1¥1¿cš#¿#ŒÌ#H_}öáf@Œ"Ë1ØË1ïË1ÌìË1 Ë1؈˜ˆö\ŸÑ€ƒ4Ôº à ÐìÃ2µßÃ2Ã2Ã2¿cÃ2é!Ã2Ã2ïÃ2é!KKÃ
Mã
D§ñù›K¨îé¥ö!è3Œ"è3ÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÔÙÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ«1ÔÙè ø ÔÙ«1ŸÔ¿cŒŒÑõ  †|À§M
ªÄc¦7µß¦7¦7¦7íߦ7¦7º¦7ïÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ’4ï¥1ï³4ئ7Ù «1ÔÙ PhantomDataÁFu\»Ÿ«1Ô


¨Œ&YK)öŒ,AðÛ¼ò
õ
.0 žŒ¤¤Œ6RK=V
µ¾ÇÐÙâëôý˜¡ªdÛ¼i
pâ
ì• ˜Œ©Œ¯Œ ¿cŒ"Ø ïÌì Ðìµßé! ö!ÙÄccíߺĜ
"„œ
ñ43D ³üóL K’4 ¾Åü¾Pè3’4ÑÛÑÛ MaybeUninitÁÓÛuninitÁÝÔÛ»ÝÍõƒ«%9’4ú’4ùã
i˜üŠÇ!D¢Ç 
%¼ŠÇ
Pà74G ªÇ$¿Ç  Û¼æ7ü›Æ³ Œà7Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙæ7 ÍÇ ÔÇüåÅï㌌Ñõ  †|À§M
à7@$ŒÆà7DüÅKKÃ
Mã
D§ñù›K¨îéà7à7@KõO¾Ö† ŒÈ†Ô³4ц&()Áç» ŒÙ»Õ³4â»&()Á݉ ŒÏ‰Ö³4؉&()Á ¾ ‹3‘3+Ã263=D É ‹3‘3+Ã263=D2D\x€×öíýÙýPƒçïÑ$ÿŒZeroFromÁDÕ
ˆ«E4ˆü²¬ü™jg This crate provides [`Yoke<Y, C>`][Yoke], which allows one to "yoke" (attach) a zero-copy deserializedÁü„ object (say, a [`Cow<'a, str>`](alloc::borrow::Cow)) to the source it was deserialized from, (say, an [`Rc<[u8]>`](alloc::rc::Rc)),ÁüŒif known in this crate as a "cart", producing a type that looks like `Yoke<Cow<'static, str>, Rc<[u8]>>`Áüö*' and can be moved around with impunity.Á¡úü¥fc Succinctly, this allows one to "erase" static lifetimes and turn them into dynamic ones, similarlyÁüŒTQ to how `dyn` allows one to "erase" static types and turn them into dynamic ones.ÁáúüåXU Most of the time the yokeable `Y` type will be some kind of zero-copy deserializableÁü¾ UR abstraction, potentially with an owned variant (like [`Cow`](alloc::borrow::Cow),Áü”
 [`ZeroVec`](https://docs.rs/zerovec), or an aggregate containing such types), and the cart `C` will be some smart pointer likeÁü— Ž [`Box<T>`](alloc::boxed::Box), [`Rc<T>`](alloc::rc::Rc), or [`Arc<T>`](std::sync::Arc), potentially wrapped in an [`Option<T>`](Option).Á¦ úüª da The key behind this crate is [`Yoke::get()`], where calling [`.get()`][Yoke::get] on a type likeÁü
a^ `Yoke<Cow<'static, str>, _>` will get you a short-lived `&'a Cow<'a, str>`, restricted to theÁüñ
pm lifetime of the borrow used during [`.get()`](Yoke::get). This is entirely safe since the `Cow` borrows fromÁüâro the cart type `C`, which cannot be interfered with as long as the `Yoke` is borrowed by [`.get()`](Yoke::get).ÁüÕif [`.get()`](Yoke::get) protects access by essentially reifying the erased lifetime to a safe local oneÁœ¿ when necessary.ÁÓúü×74 See the documentation of [`Yoke`] for more details.Á2D\x€×öíÌýÍÙýÞPƒçÍïÑÌŒ«EÃ
ˆ«EÕ4ˆCFI¤ÔüË85 Types for optional pointers with niche optimization.ÁúüˆNK The main type is [`CartableOptionPointer`], which is like `Option<Rc>` butÁü×MJ with a niche so that the resulting `Yoke` has a niche. The following fourÁü¥74 types can be stored in the `CartableOptionPointer`:ÁÝú 1. `&T`Á 2. `Box<T>`Á 3. `Rc<T>`Á 4. `Arc<T>`Áœúü OL These four types implement the sealed unsafe trait [`CartablePointerLike`].ÁüðKH In addition, all except `Box<T>` impl [`CloneableCartablePointerLike`],Áü¼@= which allows [`CartableOptionPointer`] to implement `Clone`.Á çl‰ï»8\Û»8§ StableDerefÁ\˜É4 
¤‚€ÌÍo”ìOü„8ü‘ "d” § ïíe¼îËè¿*’4¥  Íì’4 ¡ 
4 
¤º   Ã4ƒ „ë  Îìœë ã^ã^|†Eü:ü˜85 An object fully representable by a non-null pointer.ÁÑú # SafetyÁâú¼æ Implementer safety:Áþúü‚`] 1. `into_raw` transfers ownership of the values referenced by [`StableDeref`] to the caller,Áüã(% if there is ownership to transferÁüŒWT 2. `drop_raw` returns ownership back to the impl, if there is ownership to transferÁäúüè_\ Note: if `into_raw` returns the sentinel pointer, memory leaks may occur, but this will notÁüÈ  lead to undefined behaviour.ÁéúüíXU Note: the pointer `NonNull<Self::Raw>` may or may not be aligned and it should neverÁüÆVS be dereferenced. Rust allows unaligned pointers; see [`std::ptr::read_unaligned`].Áœ®ã^üØë^ ë^ã^4Äe)Òe ã^CÄe8Òe/Íìë^”füÞDA The raw type used for [`Self::into_raw`] and [`Self::drop_raw`].Á4­¿ü(üÉ.+ Converts this pointer-like into a pointer.Á4D’ë^§ ïíe¼îËè¿*œf
ë^$›üÃ0ü½74 Drops any memory associated with this pointer-like.Áùúdò^ú”š Caller safety:Á±úü¹EB 1. The pointer MUST have been returned by this impl's `into_raw`.Áüƒ(% 2. The pointer MUST NOT be dangling.Áªh³4
ë^ ü÷Bü÷?< An object that implements [`CartablePointerLike`] that alsoÁü·EB supports cloning without changing the address of referenced data.Áýúdò^Žú¼’“_ªúü®KH 1. `addref_raw` must create a new owner such that an additional call toÁüú41 `drop_raw` does not create a dangling pointerÁü¯GD 2. `addref_raw` must not change the address of any referenced data.Áäˆã^ü÷éë^œ¦ã^&Ãoã^0Ão%ü¬2ìÀ Clones this pointer-like.Áâúò^ûú”ƒëhšúü¢E“iüì(âiªh³4
ë^ äâÔ¥Íì«1 ë¥1ç
üÞ0Ô¥úq î¥1ê"$D• š «1ü¶ ¥1§ ïíe¼îËè¿*«1
Ô«1ü„!(DŽ!²s³4
Ô«1_pointerÁD—!üÏ"9Ô¥úq ß"¥1  Û"ü#*T§#²s³4
Ô«1ÈsD²#üÌLB"
ˆüØ#è34NN
Q’4üæ0¥SSß] ë©…è3TUê!ë!U \RR’4¬ÀÉ Éè3 É’4R ÉR
U’4ü©3¥WWß] ®©…è3X÷!Xüñ!Ê Êè3 Ê’4V þV
X’4üê/¥ZZß] ï©…è3["[”®Ë Ëè3³4Y Y
[4ýÙ\]ýP\]ƒ†ƒÃÛ\_µ ÿ\`|ÐU$åŒì2 "܆t“ ¢ Œ ¨ ©*« ® 3+ ¸ ¹ À8Ý8 Ê8  Ö Ü ×8(Þ á8'æ8° ï Š8+   œ8Ý4–8 ¦8®  ¸ ½8(¿8'Æ8° Ï ê8+ ô õ ü8Ý8"4†8 8Å $  §8thisÁ$•& 8$'Ÿ8°(©8 ± Ì8¼Ž$¿+ Ö × Þ8Ý8 è8Ñ  ø8 ù ú û Ž ü:Ôý88$„$ ˆ8± Š& 8 8$,˜8 ª& «:7<­ µ8
· º:Í » ½84¿ Å Ú Æ:Í Ç8Ê8'Ò8°$ Û å ƒ8± ó ô ù8% ŠÜŽt› ª ½  ° ·, ±8´²& ´8´µ*¹ ¼ º 
8"8 Ñ:ÔÒ Ô8ý Þ:Ôß á8
ã, ç8´è ë ´  8!8° 8$‡ % 8ò t™  §  ¨  © % ª % » üõ
%Ä‚  Š ¡ ¢*¤ § ,8 ±8  ½ Æ ¾:Ô¿8(È Ë:ÔÌ8'Ó8° Ü ˆ8" Í þ Ï
Ð Ñ ü 88×
Ú888æ
é88'ô8°8 8® |– ¥ ª8(¬8'³8° ¼ ã8" ­ Ù8¿8µ Ã& Æ
È88'Ó8° Ü Þ ó ß88å
è88 ô8castÁ ù ú% û88  8†ƒd•'¡8æ £ ¦ «8% ¬8µ ¾'Á8readÁ Ç Ë8µ È8"8 õ8Å  ü 8÷& 8'8°4‰(8$”  µ8 debug_assertÁ ³ ´ ã8š'¼ ¾8$¿'Ã8° Ë Ì ÍÏ8š'Ù Û8 à á â% ä8ò8µ ö ú ü8÷8
8,†8'8°48
œ8,8% §8µ8 ¹ »8†ƒ'É8æ Ë Î Ó8÷% Ô8"4“ š «8µ œ'Ÿ8­š ¥ ©8µ ¦8 À8Ñ  Ð8 Ñ Ò Ó æ Ô:ÔÕ8Ø8$ à8± â& ã8 å8$8 & ƒ:7<… 8
 :Í  84—  ² ž:Í Ÿ8¢8'ª8°$ ³ ½ 8'Ð8¾
'×8Î
´Ù ï ÷8$ ô8± ö% ˆü˜MÔe¥fefúq ¨«1gÙ«1g¤µ¡6h³´µÛÜÝÞßµ³´¤df¹ddÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ«1ÔÛüÕuÔjè kø mkmjÍìø6åÍìý6ø6lÙø6l¤óý6<nÙý6
”­K¾
xýÙýPƒ»8\úˆ»8ˆ†ƒd–ÃÛr,³é!Š®[\ÒœÏñóÌ–åü/×dÅÉ|×»Ì쑼‹l„¨]ü¾OüÅ+üï;8 A Cow-like borrowed object "yoked" to its backing data.Á«úü¯GD This allows things like zero copy deserialized data to carry aroundÁü÷QN shared references to their backing buffer, by "erasing" their static lifetimeÁüÉ2/ and turning it into a dynamically managed one.Áüúü€C@ `Y` (the [`Yokeable`]) is the object containing the references,ÁüÄFC and will typically be of the form `Foo<'static>`. The `'static` isÁü‹ RO not the actual lifetime of the data, rather it is a convenient way to mark theÁüÞ (% erased lifetime and make it dynamic.Á
úü‹
ZW `C` is the "cart", which `Y` may contain references to. After the yoke is constructed,Áüæ
YV the cart serves little purpose except to guarantee that `Y`'s references remain validÁüÀ da for as long as the yoke remains in memory (by calling the destructor at the appropriate moment).Á¥ úü© `] The primary constructor for [`Yoke`] is [`Yoke::attach_to_cart()`]. Several variants of thatÁüŠ
YV constructor are provided to serve numerous types of call sites and `Yoke` signatures.Áä
úüè
c` The key behind this type is [`Yoke::get()`], where calling [`.get()`][Yoke::get] on a type likeÁüÌaÞOü®c` lifetime of the borrow used during `.get()`. This is entirely safe since the `Cow` borrows fromÁü’a^ the cart type `C`, which cannot be interfered with as long as the `Yoke` is borrowed by `.getÁüôa^ ()`. `.get()` protects access by essentially reifying the erased lifetime to a safe local oneÁœÖ±Sêúüîli Furthermore, there are various [`.map_project()`][Yoke::map_project] methods that allow turning a `Yoke`ÁüÛc` into another `Yoke` containing a different type that may contain elements of the original yokedÁü¿A> value. See the [`Yoke::map_project()`] docs for more details.Áúü…\Y In general, `C` is a concrete type, but it is also possible for it to be a trait object.Áâú
# ExampleÁôúüøQN For example, we can use this to store zero-copy deserialized data in a cache:ÁÊú ```rustÁ¬Ú # use yoke::Yoke;Á´ð # use std::rc::Rc;Á܇ # use std::borrow::Cow;Áü£74 # fn load_from_cache(_filename: &str) -> Rc<[u8]> {ÁüÛ! # // dummy implementationÁüýKH # Rc::new([0x5, 0, 0, 0, 0, 0, 0, 0, 0x68, 0x65, 0x6c, 0x6c, 0x6f])Á # }ÁÑúüÕIF fn load_object(filename: &str) -> Yoke<Cow<'static, str>, Rc<[u8]>> {ÁüŸ52 let rc: Rc<[u8]> = load_from_cache(filename);ÁüÕOL Yoke::<Cow<'static, str>, Rc<[u8]>>::attach_to_cart(rc, |data: &[u8]| {Áü¥52 // essentially forcing a #[serde(borrow)]ÁüÛ>; Cow::Borrowed(bincode::deserialize(data).unwrap())Á })Á«úü¯/, let yoke = load_object("filename.bincode");Áüß'$ assert_eq!(&**yoke.get(), "hello");Áü‡52 assert!(matches!(yoke.get(), &Cow::Borrowed(_)));Á ```ÁªÍìà7 ÕÍìæ7 îŽÙà7Ž¤Ø¦7  †|À§M
LNÜOQüñŒŒêA<ñ"$ñ"ŒŒæ7üÿ#“ªûÈ „$‹É $Ùà7¤‡$¿cæ7„ $¿cà7Û%¦7—Àcjl$uwà$ü™%Dœ%ÌÍΠ̦7 Í c cˆ¢cµ
 `£cbufÁ `àB¤GS
ÎÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
³4ŸÈŸÈ ÈErrorÁ O˜éBL  %
à7æ7$¡%± §%üù&ŒªššûÈ þ&‹É 'Ùà7¤³'œÄcà7œÛ”ò'¦7Åc[]`b·'Ñ'üŒ(D(ÏÐÑ Ï¦7 Рc cˆ¢cµ
 `£cÏË `àB¤GS
Ñö̘ “(˜
à7æ7$”(± š(ü‹)zªŸ Ÿ ûÈ )‹É “)¡Ùà7¡¤¼)¢µßà7¢ÛùÑLû)¦7£·ß£acfhÀ)Ú)üŒ*"*ÒÓ Ò¦7 Ó¦7ž ’*ž
£à7æ7$“*¹
,™*üÜ*lª¥¦¦¥ûÈ á*‹É ä*§Ùà7§¤†+¨à7¨ÛÅ+¦7PRUWŠ+¤+üÎ+|ªª««ªûÈ Ó+‹É Ö+¬Ùà7¬¤€,­íßà7­ÛËÕT¿,¦7®ïß®acfh„,ž,üÑ,B\Ô,ÔÕ Ô¦7 Õ¦7Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ¿ßÀßÁßLessÁÂßÃßÄß~Å߯ßÇßGreaterÁÈßåºÝÈnûê7© à,©
®à7æ7$á,¹
,ç,üË-nª°±±°ûÈ Ð-‹É Ó-²Ùà7²¤ö-³ºà7³Ûµ.¦7´»´[]`bú-”.üÀ.2Ã.Ö× Ö¦7 צ7£×¯ Ç.¯
´à7æ7$È.¹
,Î.üŸ<aª¸¸ûÈ ¤<‹É ½<·Ùà7·¤§<æ7\À<æ7ê!<ø<¦7¹¼ÀÂWY«<bdü¡R£ü‡=EB Construct a [`Yoke`] by yokeing an object to a cart in a closure.ÁÑ=úüÙ=QN The closure can read and write data outside of its scope, but data it returnsÁü¯><9 may borrow only from the argument passed to the closure.Áð>úüø>RO See also [`Yoke::try_attach_to_cart()`] to return a `Result` from the closure.ÁÏ?úü×?UR Call sites for this function may not compile pre-1.61; if this still happens, useÁü±@41 [`Yoke::attach_to_cart_badly()`] and file a bug.Áê@útò@ # ExamplesÁ…Aú<AÅǬ™A¿À´³AÝÀÜÎAüÀüîA7¡ÁüªB!âÁüÐBKÂ< Cá¬Cúü´CIþÂü‚D5ÑÃü¼DOÄüE5éÄüÊE>¨ÅTFïÅ,œF‚ƦFúü®FB? let yoke: Yoke<Cow<str>, _> = load_object("filename.bincode");ÁüõF'ÖÆü¡G5‡Ç<ÛGÅÇçGúüïG;8 Write the number of consumed bytes to a local variable:Á¯Hú<·HÅǬÃH¿À´ÝHÝÀÜøHüÀü˜I7¡ÁüÔI!âÁüúI?< # Rc::new([0x5, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0, 0, 0])Á<¾JáÂÊJúœÒJ fn load_object(Á¼êJ filename: &str,Áü†K52 ) -> (Yoke<Cow<'static, str>, Rc<[u8]>>, usize) {ÁüÀK5ÑÃüúK$! let mut bytes_remaining = 0;Áü£L30 let bytes_remaining = &mut bytes_remaining;ÁüÛLGD let yoke = Yoke::<Cow<'static, str>, Rc<[u8]>>::attach_to_cart(Á|§M rc,ÁÜ»M |data: &[u8]| {ÁüÛMEB let mut d = postcard::Deserializer::from_bytes(data);Áü¥NEB let output = serde::Deserialize::deserialize(&mut d);ÁüïN?< *bytes_remaining = d.finalize().unwrap().len();Áü³O.+ Cow::Borrowed(output.unwrap())ÁtæO },ÁTùO );ÁüˆP  (yoke, *bytes_remaining)Á,­P‚Æ·Púü¿PC@ let (yoke, bytes_remaining) = load_object("filename.postcard");Áü‡Q'ÖÆü³Q5‡ÇüíQ# assert_eq!(bytes_remaining, 3);Á<•RÅÇt¨Ræ7ܪ¦7µººµµ« ·R»–"ܪ »ÆÛüÒUJ»ܪ¹í˜"à7»Ûä€VÄÛ<¼V
¹à7æ7ܪ$ºR± ÃR|~ÖUüä\Ôü©ZRO Construct a [`Yoke`] by yokeing an object to a cart. If an error occurs in theÁü€[@= deserializer function, the error is passed up to the caller.ÁÅ[úüÍ[U„Þü§\85 [`Yoke::try_attach_to_cart_badly()`] and file a bug.Á”ë\æ7Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¦7µ½¾¾½µÍì±ñ þ\ÍìÛð ]¿–"Ûð ¿ÆÛü»]U¿Ûð˜ò˜"Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
à7¿Û±ñüé]'ÄÛ<°^
¼à7æ7±ñÛð$„]± ]äæàâ¿]üÍcŽü¢b# Use [`Yoke::attach_to_cart()`].ÁÊbúüÒbda This was needed because the pre-1.61 compiler couldn't always handle the [`FnOnce`] trait bound.Ál»c¤Ôcæ7Á ÁÆÛà7ÁÛ¦7µµ
Àà7æ7$òc± ƒdŠdü¾f«üe'$ Use [`Yoke::try_attach_to_cart()`].Á»eúüÃedÀól¬fÄÅfæ7Ä ÄÆÛÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
à7ÄÛ±ñàðµÃõæñ Þf
Âà7æ7±ñ$êf± ûf#%‚güŸh+ªÆÈÆÈûÈ ¤h‹É ½hÇÙà7Ǥ§h¦7ÉËÌÍÐÔÙAC«hLNü×q;üÑh1. Obtain a valid reference to the yokeable dataÁ
be valid.ÁüóiJG For example, if you're working with a `Yoke<Cow<'static, T>, C>`, thisÁüÂj# will return an `&'a Cow<'a, T>`Áêjúlòj¢¿„kú\Œk«À¬œk¿À´¶kÝÀÜÑküÀüñk7¡Áü­l!âÁüÓlKÂ<£máÂ,¯mü¹mKH # fn load_object(filename: &str) -> Yoke<Cow<'static, str>, Rc<[u8]>> {Áü‰n74 # let rc: Rc<[u8]> = load_from_cache(filename);ÁüÅnQN # Yoke::<Cow<'static, str>, Rc<[u8]>>::attach_to_cart(rc, |data: &[u8]| {Áü›o@= # Cow::Borrowed(bincode::deserialize(data).unwrap())Ádào # })Á<ñoáÂýoúü…pC@ // load_object() defined in the example at the top of this pageÁüÍpB³áü”q$! assert_eq!(yoke.get(), "hello");Á<½qÅÇÞqÊ Ê¦7 Êà7ÊÛÅâqÅ
Éà7æ7$êqüµt üÂr(% Get a reference to the backing cart.Áïrúü÷rXU This can be useful when building caches, etc. However, if you plan to store the cartÁüÔs\Y separately from the yoke, read the note of caution below in [`Yoke::into_backing_cart`].Ád¼tØ Ø¦7 Øæ7Å ÉtÅ
Ëà7æ7$Êtü¢#üöt@= Get the backing cart by value, dropping the yokeable object.Á»uúüÃu]Z **Caution:** Calling this method could cause information saved in the yokeable object butÁü¥v[X not the cart to be lost. Use this method only if the yokeable object cannot contain itsÁ¤…w own information.Ážwúl¦w¢¿¸wúüÀwYV Good example: the yokeable object is only a reference, so no information can be lost.Ážxú<¦xÅÇœ²x use yoke::Yoke;ÁÊxúüÒx&# let local_data = "foo".to_owned();ÁüýxKH let yoke = Yoke::<&'static str, Box<String>>::attach_to_zero_copy_cart(ÁìÍy Box::new(local_data),Á4ïy );Áüúy# assert_eq!(*yoke.get(), "foo");Á¢zúĪz // Get back the cartÁüÇz(% let cart = yoke.into_backing_cart();Áôôz assert_eq!(&*cart, "foo");Á<—{ÅÇ£{úü«{@= Bad example: information specified in `.with_mut()` is lost.Áð{ú<ø{ÅÇÌ„| use std::borrow::Cow;Áœ¢|¸ˆº|úüÂ|&ሔí| let mut yoke =Áü„}IF Yoke::<Cow<'static, str>, Box<String>>::attach_to_zero_copy_cart(ÁüÒ}! Box::new(local_data),ÁTø}íéü‡~" assert_eq!(yoke.get(), "foo");Á®~úü¶~  // Override data in the cartÁÌÛ~ yoke.with_mut(|cow| {Áüù~# let mut_str = cow.to_mut();ÁÄ¡ mut_str.clear();Áü¾  mut_str.push_str("bar");Á });Áüï" assert_eq!(yoke.get(), "bar");Á–€úÄž€ÓŠü»€(õŠüè€)& assert_eq!(&*cart, "foo"); // WHOOPS!Á<ÅÇŒ©¦7æ7ÅÅ
Ìà7æ7üLüå74 Unsafe function for replacing the cart with anotherÁ¡‚úü©‚<9 This can be used for type-erasing the cart, for example.Áê‚údò‚ò^ƒƒúü‹ƒTQ - References from the yokeable `Y` should still be valid for the lifetime of theÁìäƒ returned cart type `C`.Á†„úüŽ„^[ For the purpose of determining this, `Yoke` guarantees that references from the YokeableÁüñ„b_ `Y` into the cart `C` will never be references into its stack data, only heap data protectedÁüØ…eb by `StableDeref`. This does not necessarily mean that `C` implements `StableDeref`, rather thatÁü†eb any data referenced by `Y` must be accessed through a `StableDeref` impl on something `C` owns.Á¬‡úü´‡gd Concretely, this means that if `C = Option<Rc<T>>`, `Y` may contain references to the `T` but notÁ¤ ˆ anything else.Áü¹ˆ[X - Lifetimes inside C must not be lengthened, even if they are themselves contravariant.Áü™‰XU I.e., if
à7ÔÅÔÎÞÏÎÏÅÍì² ¸ÍìðŸ¤Å–"ðŸæ7🖡˜"² ×
Íà7æ7² ðŸ± Âikdfü‰§~üê’(% Mutate the stored [`Yokeable`] data.Á—“úüŸ“YV If the callback needs to return `'static` data, then [`Yoke::with_mut_return`] can beÁüý“VS used until the next breaking release of `yoke`, at which time the callback to thisÁüØ”74 function will be able to return any `'static` data.Á”•úüœ•EB See [`Yokeable::transform_mut()`] for why this operation is safe.Áæ•úlî•¢¿€–úüˆ–B? This can be used to partially mutate the stored data, providedÁüÏ–)& no _new_ borrowed data is introduced.Áý–ú\…—«Àü•—! # use yoke::{Yoke, Yokeable};Á´»—ÝÀÜÖ—üÀœö— # use std::mem;ÁüŽ˜7¡Áüʘ!âÁüð˜KÂ<À™áÂ,Ì™æüüÖ™FC # fn load_object(filename: &str) -> Yoke<Bar<'static>, Rc<[u8]>> {Áü¡š7ÊýüÝšLI # Yoke::<Bar<'static>, Rc<[u8]>>::attach_to_cart(rc, |data: &[u8]| {Áü®›RO # // A real implementation would properly deserialize `Bar` as a wholeÁœ…œ # Bar {ÁüœNK # numbers: Cow::Borrowed(bincode::deserialize(data).unwrap()),ÁüðœMJ # string: Cow::Borrowed(bincode::deserialize(data).unwrap()),ÁüÂ$! # owned: Vec::new(),Á # }Ádÿ¯ÿ<žáœžú¼¤ž #[derive(Yokeable)]Á¤Àž struct Bar<'a> {ÁüÙž numbers: Cow<'a, [u8]>,Áìýž string: Cow<'a, str>,Á¼ŸŸ owned: Vec<u8>,Á,»Ÿ‚ÆÅŸúüÍŸ96 // `load_object()` deserializes an object from a fileÁü‹ @= let mut bar: Yoke<Bar, _> = load_object("filename.bincode");ÁüР*' assert_eq!(bar.get().string, "hello");Áüÿ :7 assert!(matches!(bar.get().string, Cow::Borrowed(_)));Áü¾¡EB assert_eq!(&*bar.get().numbers, &[0x68, 0x65, 0x6c, 0x6c, 0x6f]);Áüˆ¢;8 assert!(matches!(bar.get().numbers, Cow::Borrowed(_)));ÁüÈ¢'$ assert_eq!(&*bar.get().owned, &[]);Áô¢úÄü¢ bar.with_mut(|bar| {Áü™£/, bar.string.to_mut().push_str(" world");ÁüÍ£63 bar.owned.extend_from_slice(&[1, 4, 1, 5, 9]);Á<ˆ¤´”¤úüœ¤0- assert_eq!(bar.get().string, "hello world");ÁüѤ74 assert!(matches!(bar.get().string, Cow::Owned(_)));Áü¥41 assert_eq!(&*bar.get().owned, &[1, 4, 1, 5, 9]);ÁüÆ¥(% // Unchanged and still Cow::BorrowedÁüó¥EƯü½¦;–°<ý¦ÅÇD§ Ô¦7Ûð³4ÅÔÑÒÑÒÅ÷ñ §Ûð<ɧÓ"Ûð Óà7ÔÛüÓ§3ÓÛð⶘"³4üÛ§+
Ðà7æ7ÔÛð$¨§± ®§™§Ž×§ü†¬¦üÁ¨XU Mutate the stored [`Yokeable`] data, and return `'static` data (possibly just `()`).Áž©úü¦©TQ See [`Yokeable::transform_mut()`] for why this operation is safe, noting that noÁtÿ© `'static`.Á’ªú¼šª ### Will be removedÁü¶ª\Y This method will be removed on the next breaking release of `yoke`, when the callback ofÁü—«ZW [`Yoke::with_mut`] will gain the ability to return any `R: 'static` and supersede thisÁ\ö« method.Á|¬Ûð£ÅÔÕÖ£×Ö×ÕÅ÷ñ ¡¬Íì…¼ ¤¬ƶ<Õ¬Ø"Ûð Øí¶ü߬8ØÛðû¼˜"…¼ –­…¼<¤­
Ôà7æ7ÔÛð…¼$¯¬± µ¬¬¡£œžã¬üÜ®6üü­MJ Helper function allowing one to wrap the cart type `C` in an `Option<T>`.Áœã®¦7™AÅÅ
Ùà7æ7$÷®üÁ°)ªÛÛûÈ ưÜÙà7ܤɰŒŒÑõ  †|À§M
à7³4ÝÞikͰü¢·,üñ°?< Construct a new [`Yoke`] from static data. There will be noÁüµ±@= references to `cart` here since [`Yokeable`]s are `'static`,Áüú±2/ this is good for e.g. constructing fully ownedÁü±²)& [`Yoke`]s with no internal borrowing.Áß²úüç²IF This is similar to [`Yoke::new_owned()`] but it does not allow you toÁüµ³A> mix the [`Yoke`] with borrowed data. This is primarily usefulÁüû³,) for using [`Yoke`] in generic scenarios.Á¬´úl´´¢¿Æ´ú\δ«À¬Þ´¿ÀÜø´üÀ˜µúü µ41 let owned: Cow<str> = "hello".to_owned().into();ÁüÙµA> // this yoke can be intermingled with actually-borrowed YokesÁüŸ¶A> let yoke: Yoke<Cow<str>, ()> = Yoke::new_always_owned(owned);Áå¶úüí¶$¹€<–·ÅÇ„©·à7õ¿ÚÚ
Ýà7õDº·ü»»üï¹.+ Obtain the yokeable out of a `Yoke<Y, ()>`Á¢ºúüªº74 For most `Yoke` types this would be unsafe but it'sÁüæº=: fine for `Yoke<Y, ()>` since there are no actual internalÁt¨» referencesÁl»õ¿à7ÚÚ
Þà7$лü“¾3ªàââàûÈ ˜¾‹É ±¾áÙà7ᤛ¾™Aãä57Ÿ¾@BüåÅ+ü;?á¿ü‘¿@«ÀüÖ¿2öÀüÀ)³Á»ÀúüÃÀIF This can be paired with [`Yoke:: wrap_cart_in_option()`] to mix ownedÁ´‘Á and borrowed data.Á¬Áúü´ÁXU If you do not wish to pair this with borrowed data, [`Yoke::new_always_owned()`] canÁü‘Â74 be used to get a [`Yoke`] API on always-owned data.ÁÍÂúlÕ¢¿çÂú\ï«À¬ÿ¿ÀÜ™ÃüÀ´¹ÃÝÀÔÃúüÜÃ4ªÄü•ÄAéÄüÛÄHE let yoke: Yoke<Cow<str>, Option<Rc<[u8]>>> = Yoke::new_owned(owned);Á¨Åúü°Å$¹€<ÙÅÅÇLòÅà7™Aßß
ãà7æ7õc üŸÉ1üÚÇB? Obtain the yokeable out of a `Yoke<Y, Option<C>>` if possible.Á¡Èúü©ÈHE If the cart is `None`, this returns `Ok`, but if the cart is `Some`,ÁüöÈ$! this returns `self` as an error.ÁŒ¦É™AÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
à7™Aßß
äà7æ7$¸ÉüãËHªæèèæûÈ èË‹É ÌçÙà7ç¤ëËæ7œ„Ì™AéACïËLNü³ÙRü²ÌJG Converts a `Yoke<Y, Option<C>>` to `Yoke<Y, CartableOptionPointer<C>>`ÁüÍ96 for better niche optimization when stored as a field.Á¿ÍútÇͬßÚÍú<âÍÅÇÌîÍÉŒœŒÎ¸ˆ¤Îúü¬Î-* let yoke: Yoke<Cow<[u8]>, Box<Vec<u8>>> =ÁüÞÎDA Yoke::attach_to_cart(vec![10, 20, 30].into(), |c| c.into());Á§Ïúü¯Ï1. let yoke_option = yoke.wrap_cart_in_option();ÁüåÏMJ let yoke_option_pointer = yoke_option.convert_cart_into_option_pointer();Á<·ÐÅÇÃÐúüËÐ# The niche improves stack sizes:ÁóÐú<ûÐÅÇœ‡Ñ¸ˆüŸÑ2/ use yoke::cartable_ptr::CartableOptionPointer;Á¤ÖÑ use std::rc::Rc;ÁïÑúü÷Ñ" // The data struct is 6 words:ÁüžÒ # #[derive(yoke::Yokeable)]ÁüÂÒ # struct MyDataStruct<'a> {ÁüæÒ+( # _s: (usize, usize, usize, usize),Á´–Ó # _p: &'a str,Á<±ÓáÂü½Ó(% const W: usize = size_of::<usize>();ÁüêÓ1. assert_eq!(W * 6, size_of::<MyDataStruct>());Á Ôúü¨ÔOL // An enum containing the data struct with an `Option<Rc>` cart is 8 words:ÁÄüÔ enum StaticOrYoke1 {Áü™Õ/, Static(&'static MyDataStruct<'static>),ÁüÍÕ>; Yoke(Yoke<MyDataStruct<'static>, Option<Rc<String>>>),Á,Ö‚ÆüšÖ2/ assert_eq!(W * 8, size_of::<StaticOrYoke1>());ÁÑÖúüÙÖW
à7š#¿#ŒÌ#H_}öáf@æ7åå
éà7æ7$ÛÙüÝÞWªëííëûÈ âÞ‹É ûÞìÙà7ì¤åÞ´ÔœþÞ…ãî<>éÞGIüá1ü»ßQN Obtain the yokeable out of a `Yoke<Y, CartableOptionPointer<C>>` if possible.Á‘àúü™àHÉÐüæà$œÑŒ¤á…ãÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
à7…ãêê
îà7æ7$¶áüúé%ü×âDA This trait marks cart types that do not change source on cloningÁœãúü ãMJ This is conceptually similar to [`stable_deref_trait::CloneStableDeref`],ÁüîãOL however [`stable_deref_trait::CloneStableDeref`] is not (and should not) beÁü¾äZW implemented on [`Option`] (since it's not [`Deref`]). [`CloneableCart`] essentially isÁü™åUR "if there _is_ data to borrow from here, cloning the cart gives you an additionalÁìïå handle to the same data".Áæúd‘æò^üžæˆ This trait is safe to implement on `StableDeref` types which, once `Clone`d, point to the same underlying data and retain ownership.Á§çúü«çŽ This trait can also be implemented on aggregates of such types like `Option<T: CloneableCart>` and `(T: CloneableCart, U: CloneableCart)`.Áºèúü¾èŠ Essentially, all data that could be referenced by a Yokeable (i.e. data that is referenced via a [`StableDeref`]) must retain the sameÁüÉé0- pointer and ownership semantics once cloned.Ál‹êïïã^üúé(Øë^,šêïã^)²ðã^4²ð)üéì9¥ññß] õìï’4løì­8ü»î2Ôó¥ôôóÎì«1 Ëî¥1Çîü™ï ³4üâózü¾ïgd Clone requires that the cart type `C` derefs to the same address after it is cloned. This works forÁ¼¦ð Rc, Arc, and &'a T.Á¾ðúüÂð`] For other cart types, clone `.backing_cart()` and re-use `.attach_to_cart()`; however, doingÁü£ñ63 so may lose mutations performed via `.with_mut()`.ÁÚñúüÞñ_\ Cloning a `Yoke` is often a cheap operation requiring no heap allocations, in much the sameÁü¾òa^ way that cloning an `Rc` is a cheap operation. However, if the `yokeable` contains owned dataÁü óA> (e.g., from `.with_mut()`), that data will need to be cloned.Áª÷ùù÷ûÈ çó‹É €ôøÙà7ø¤êóïæ7lƒôúØà7úÛ,Öô¦7ûÙûoqîóz|µô¼ãô,æôÙ Ù¦7¦7ö ìôö
ûà7æ7$íôüøþ+ªýÿýÿûÈ ýþ‹É –ÿþÙà7þ¤€ÿ¦7€˜£©GI„ÿRTüƒ’ìüªÿWT Allows one to "project" a yoke to perform a transformation on the data, potentiallyÁü†€ZW looking at a subfield, and producing a new yoke. This will move cart, and the providedÁüå€RO transformation is only allowed to use data known to be borrowed from the cart.Á¼úüÄ\Y If producing the new [`Yokeable`] `P` requires access to the cart in addition to the oldÁü¥‚_\ `Y`, then [`Yoke::map_with_cart`] can be used if the cart satisfies additional constraints.Á‰ƒúü‘ƒUR The callback takes an additional `PhantomData<&()>` parameter to anchor lifetimesÁüëƒQN (see [#86702](https://github.com/rust-lang/rust/issues/86702)) This parameterÁüÁ„+( should just be ignored in the callback.Áñ„úüù„PM This can be used, for example, to transform data from one format to another:ÁÎ…ú<Ö…ÅÇ´â…ÝÀ¬ý…¿À,—†æüü¡†PM fn slice(y: Yoke<&'static str, Rc<[u8]>>) -> Yoke<&'static [u8], Rc<[u8]>> {Áüö†1. y.map_project(move |yk, _| yk.as_bytes())Á,¬‡‚Æ<¶‡ÅÇ
¡æ7ü¡üÍì –’÷ñ ™’ƒÙƒ¤Ë’–"Ûðà7Û»8Fu\»Ÿ ³4üì’Ûð˜"ÛÜÓ“
à7æ7Ûð$œ’± ¢’ÝßáãÏ’ð’ü¿š¢üá—FC This is similar to [`Yoke::map_project`], however it does not moveÁü¬˜RO [`Self`] and instead clones the cart (only if the cart is a [`CloneableCart`])Áƒ™úü‹™a^ This is a bit more efficient than cloning the [`Yoke`] and then calling [`Yoke::map_project`]Áüñ™IF because then it will not clone fields that are going to be discarded.Á”Æš º¦7ŒŒÑõ  †|À§M
¡æ7üº¡ˆˆüÍ츕 àšÍìù” ãšÙ¸•¤œ›ð÷l½›Š–"ù” ºà7ŠÛ»8Fu\»Ÿ г4ü×›Šù”Ù–˜"¸•ŠÛÜÅœ
à7æ7º¸•ù”$íš± óš,Ùš ›Û›üØ®ü¹ TQ This is similar to [`Yoke::map_project`], however it can also bubble up an errorÁ´’¡ from the callback.Á­¡ú<µ¡ÅÇ´Á¡ÝÀ¬Ü¡¿Àüö¡&# # use std::str::{self, Utf8Error};Á,¡¢æül«¢
fn slice(Áü½¢)& y: Yoke<&'static [u8], Rc<[u8]>>,Áüë¢:7 ) -> Result<Yoke<&'static str, Rc<[u8]>>, Utf8Error> {Áüª£@= y.try_map_project(move |bytes, _| str::from_utf8(bytes))Á,Æ<ù£ÅÇ…¤úü¤9Ó‚ˤú<Ó¤ÅÇüߤ!𥜅¥·¦´¥ÝÀü¸¥&,ã¥æüüí¥*냤œ¦‘¬Ôµ¦ bytes_1: &'a [u8],ÁÔԦф,󦂯ý¦úä…§ü¦§*·…üÕ§:‹šü”¨A> bar.try_map_project(|bar, _| str::from_utf8(bar.bytes_1))Á,Ú¨‚Æä¨ú,ì¨æüüö¨5€‡ü°© À‡üÕ©1뇔‹ª¦ˆ\¢ªˆ,²ªæüü¼ª/æˆüðª< ‰”±«¦ˆ\È«ˆ,Ø«æüüâ«1‘Šü˜¬-ÍŠ\ʬˆ,Ú¬æüüä¬1¡‹|š­Ü‹ü®­8ö‹\ë­¸Œüû­0ÎŒ\°®ˆ<À®áÂ<Ì®ÅÇ|ß®¦7ÛðÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ËŽü¡ŒŽŒŽü½ ï®÷ñ ò®Íìø¢ õ®Ù¤²¯–"Ûðà7Û»8Fu\»Ÿ ³4üÓ¯Ûð¤˜"Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Ûø¢üº°&
à7æ7Ûðø¢$ø®± þ®FILOIL¶¯ׯüº·¿üØ´JG This is similar to [`Yoke::try_map_project`], however it does not moveÁü§µR²‘þµúü†¶aœ’üì¶Iˆ“´Á·ð”ù”Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
þ”üº¡üý• ß· â·ÍìϨ å·Ù¸•¤©¸ð÷lʸ–"ù” ºà7Û»8Fu\»Ÿ ³4üä¸ù”ü©˜"Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¸•ÛϨüÒ¹&
à7æ7º¸•ù”Ϩ$ï·± õ·,Ø·cfilfi­¸è¸üŽÀ³üÕ½PM This is similar to [`Yoke::map_project`], but it works around older versionsÁüª¾NK of Rust not being able to use `FnOnce` by using an explicit capture input.Áüý¾B? See [#1061](https://github.com/unicode-org/icu4x/issues/1061).ÁÄ¿úüÌ¿=: See the docs of [`Yoke::map_project`] for how this works.Áü•À!¦7¥œà7œÛÀ¯»8Fu\»Ÿ œ³4œÛËŽü¡¥ššü½ ·ÀÍìÀ¯ ºÀÙ¤¬Â
˜à7æ7À¯$ÆÀcaptureÁ<ÔÀ± èÀjleg°ÂïÀü²ÉéüëÆWT This is similar to [`Yoke::map_project_cloned`], but it works around older versionsÁüÇÇN¯¬üšÈBˆ­áÈúüéÈDA See the docs of [`Yoke::map_project_cloned`] for how this works.Áü¹É(ž ž¦7À¯¢ žà7¢ÛÀ¯»8Fu\»Ÿ ¢³4¢ÛËŽü¡Ÿ¥  Ÿ,âÉü½ éÉæ° ìɡ١¤ìËð÷lÌ
à7æ7À¯$ÿɳ°<ʱ ¡Êrthjlnð˨ÊüäÒÐüüÏTQ This is similar to [`Yoke::try_map_project`], but it works around older versionsÁüÕÐN¯¬ü¨ÑBˆ­ïÑúü÷ÑA> See the docs of [`Yoke::try_map_project`] for how this works.ÁüëÒ%¦7À¯¨à7¨ÛÀ¯»8Fu\»Ÿ ¨³4Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¨Ûø¢¦¢ü¡¤¥¥¦¤¥¦ü
the cart.Á‚æúüŠæ\Y If access to the old [`Yokeable`] `Y` is sufficient to produce the new [`Yokeable`] `P`,ÁüëæXU then [`Yoke::map_project`] should be preferred, as `map_with_cart` places additionalÁäÈç constraints on the cart.Áéçúüñç_\ This can be used, for example, to transform data between two formats, one of which containsÁtÕè more data:Áèèú<ðèÅÇüüè!𥜢鷦´ºéÝÀ,Õéæüüßé\Y // Both structs have `first_line`, which won't need to be recomputed in `map_with_cart`.ÁüÀê0- // They also safely implement `Yokeable<'a>`Á¤õê struct Foo<'a> {ÁüŽë$! first_line: Option<&'a str>,Á,·ë‚ƤÁ둬üÚë$ïÈüƒì# last_line: Option<&'a str>,Á,«ì‚Ƶìú”½ì fn foo_to_bar(ÁüÔì)& foo: Yoke<Foo<'static>, Rc<str>>,Áü‚í&# ) -> Yoke<Bar<'static>, Rc<str>> {Áü­í'$ foo.map_with_cart(|foo, cart| {ÁŒÙí Bar {Áüïí+( first_line: foo.first_line,ÁüŸî41 last_line: cart.lines().next_back(),ÁlØî
TêîïÅ,ùî‚Æƒïú”‹ï fn bar_to_foo(Áü¢ï)& bar: Yoke<Bar<'static>, Rc<str>>,ÁüÐï&# ) -> Yoke<Foo<'static>, Rc<str>> {Áüûï" bar.map_project(|bar, _| {ÁŒ¢ð Foo {Áü¸ð+( first_line: bar.first_line,ÁlèðÔÌTúðïÅ,‰ñ‚Æ“ñú,›ñæüü¥ñ52 # unsafe impl<'a> Yokeable<'a> for Foo<'static> {Áüßñ  # type Output = Foo<'a>;Áü„ò1. # fn transform(&'a self) -> &'a Foo<'a> {Á”ºò¦ˆ\Ñòˆ,áòæüüëò/, # fn transform_owned(self) -> Foo<'a> {ÁüŸó< ‰”àó¦ˆ\÷óˆ,‡ôæüü‘ô1. # unsafe fn make(from: Foo<'a>) -> Self {ÁüÇô-ÍŠ\ùôˆ,‰õæüü“õ1¡‹|ÉõÜ‹üÝõ8ö‹\šö¸Œüªö0ÎŒ\ßöˆ<ïöáÂ,ûöæüü…÷5€‡ü¿÷ À‡üä÷1ë‡”šø¦ˆ\±øˆ,ÁøæüüËø/æˆüÿø< ‰”Àù¦ˆ\×ùˆ,çùæüüñù1‘Šü§ú-ÍŠ\Ùúˆ,éúæüüóú1¡‹|©ûÜ‹ü½û8ö‹\úû¸ŒüŠü0ÎŒ\¿üˆ<ÏüáÂ<ÛüÅÇl­ý¦7ÛðËŽ°¡µµ°½ »ý÷ñ ¾ý·Ù·¤ðý¸–"Ûðà7¸Û ¸ÆÛü‘þ¸ÛðÏØ˜"¸ÛÜýþÄÛ<¸ÿ
´à7æ7Ûð$Áý± ÇýÁÃÅÇôý•þüªˆÐüÛƒYV This is similar to [`Yoke::map_with_cart`], but it does not move [`Self`] and insteadÁü¹„>; clones the cart (only if the cart is a [`CloneableCart`]).Áü„úü„…KH This is a bit more efficient than cloning the [`Yoke`] and then callingÁüÔ…\Y [`Yoke::map_with_cart`] because it will not clone fields that are going to be discarded.Áµ†úü½†\ÜÃüž‡[X then [`Yoke::map_project_cloned`] should be preferred, as `map_with_cart_cloned` placesÁüþ‡'$ additional constraints on the cart.Á¤±ˆð”ù”þ”°ºº¡»¼º»¼°ý• ͈ Ј½Ù¸•½¤‰‰¾–"ù” ºà7¾Û ¾ÆÛüª‰Ž¾ù”Óߘ"¸•¾ÛÜŠð÷lÅŠÄÛ<òŠ
¹à7æ7º¸•ù”$Úˆ± àˆ,ƈÞàâ䮉ü£•·üØŽRO This is similar to [`Yoke::map_with_cart`], but it can also bubble up an errorÁ´¯©˜ÊúüÒ\ÜÃü³UR then [`Yoke::try_map_project`] should be preferred, as `try_map_with_cart` placesÁü'†Ý¹‘ú<Á‘ÅÇ´Í‘ÝÀ¬è‘¿Àü‚’&,­’æüä·’ // Implements `Yokeable`ÁüØ’+( type P<'a> = (&'a str, Option<&'a u8>);Áˆ“úl¿™ü¢“)×™üГ85 ) -> Result<Yoke<P<'static>, Rc<[u8]>>, Utf8Error> {Áü0- y.try_map_with_cart(move |bytes, cart| {Áü”74 Ok((str::from_utf8(bytes)?, bytes.first()))ÁTþ”ïÅ,‚Æ<—•ÅÇŒª•¦7Û𦢰¡ÀÁÂÂÀÁ°½ ¼•÷ñ ¿•Σ •ÃÙäÿ•Ä–"Ûðà7ÄÛ ÄÆÛü –ÄÛðè˜"Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ÄÛø¢üŒ—&ÄÛ<Ò—
¿à7æ7Ûðø¢$Å•± Ë•!$'*-0ƒ–¤–üØ íüú›]Z This is similar to [`Yoke::try_map_with_cart`], but it does not move [`Self`] and insteadÁüÜœ>ñÙŸúü§KÇÚü÷`] [`Yoke::try_map_with_cart`] because it will not clone fields that are going to be discarded.ÁÜžúüäž[X If access to the old [`Yokeable`] `Y` is sufficient to producethe new [`Yokeable`] `P`,ÁüÄŸ\Y then [`Yoke::try_map_project_cloned`] should
à7ˆ˜ˆö\ŸÑ€ƒ4Ôæ7ÌÑÑÌÍì ÷ ‡à
Ðà7æ7 ÷$ŠàüåãBü»áPÆòâúü˜âJG This function wraps the cart into the `B` variant. To wrap it into theÁüçâ74 `A` variant, use [`Self::wrap_cart_in_either_a()`].Á£ãúü«ã'Òô¬ìã¦7ŒŒÑõ  †|À§M
à7ˆ˜ˆö\ŸÑ€ƒ4Ôæ7ÌÓÓÌÍìõú ‚ä
Òà7æ7õú$…ä\Ȇ Ά³4\Ù» ß»³4\ω Õ‰³4däÙ»8\¼×Ø»8×ØÌ®+ü¬&üÊ_\ The `Yokeable<'a>` trait is implemented on the `'static` version of any zero-copy type; forÁüªHE example, `Cow<'static, T>` implements `Yokeable<'a>` (for all `'a`).Áóú One can useÁü‡_\ `Yokeable::Output` on this trait to obtain the "lifetime'd" value of the `Cow<'static, T>`,ÁüçFC e.g. `<Cow<'static, T> as Yokeable<'a>'>::Output` is `Cow<'a, T>`.Á®úü²OL A [`Yokeable`] type is essentially one with a covariant lifetime parameter,Áü‚RO matched to the parameter in the trait definition. The trait allows one to castÁüÕ1. the covariant lifetime to and from `'static`.Áúü‹a^ **Most of the time, if you need to implement [`Yokeable`], you should be able to use the safeÁüíC@ [`#[derive(Yokeable)]`](yoke_derive::Yokeable) custom derive.**Á±úüµRO While Rust does not yet have GAT syntax, for the purpose of this documentationÁüˆ OL we shall refer to "`Self` with a lifetime `'a`" with the syntax `Self<'a>`.ÁüØ GD Self<'static> is a stand-in for the HKT Self<'_>: lifetime -> type.Á 
úü¤
qn With this terminology, [`Yokeable`] exposes ways to cast between `Self<'static>` and `Self<'a>` generically.Áü– ]Z This is useful for turning covariant lifetimes to _dynamic_ lifetimes, where `'static` isÁüô *' used as a way to "erase" the lifetime.ÁŸ ú ò^° úü´ b_ This trait is safe to implement on types with a _covariant_ lifetime parameter, i.e. one whereÁü—
\Y [`Self::transform()`]'s body can simply be `{ self }`. This will occur when the lifetimeÁüô
da parameter is used within references, but not in the arguments of function pointers or in mutableÁüÙ;8 positions (either in `&mut` or via interior mutability)Áúü™[X This trait must be implemented on the `'static` version of such a type, e.g. one shouldÁüõA> implement `Yokeable<'a>` (for all `'a`) on `Cow<'static, T>`.Á·úü»LI This trait is also safe to implement on types that do not borrow memory.ÁˆúüŒQN There are further constraints on implementation safety on individual methods.ÁÞúäâ # Implementation exampleÁÿúüƒWT Implementing this trait manually is unsafe. Where possible, you should use the safeÁüÛ_\ [`#[derive(Yokeable)]`](yoke_derive::Yokeable) custom derive instead. We include an exampleÁü»OL in case you have your own zero-copy abstractions you wish to make yokeable.Áú\«ÀÌ› # use yoke::Yokeable;ÁܵüÀÔÑ # use std::{mem, ptr};Á¤ì‘¬ü°¬ì¡Ù¬¼¿€­‚ÆÝúüá30 unsafe impl<'a> Yokeable<'a> for Bar<'static> {Áô• type Output = Bar<'a>;Áü´/, fn transform(&'a self) -> &'a Bar<'a> {Áüä:7 // covariant lifetime cast, can be done safelyÁ„Ÿ
selfÁºúü¾-* fn transform_owned(self) -> Bar<'a> {Áüì:Ö’„§™“²“ÂúüÆ/, unsafe fn make(from: Bar<'a>) -> Self {ÁüöA> unsafe { mem::transmute::<Self::Output, Self>(from) }ÁL¸²“ÂúüÆ/, fn transform_mut<F>(&'a mut self, f: F)Á
whereÁü„63 F: 'static + FnOnce(&'a mut Self::Output),ÁüÅNK unsafe { f(mem::transmute::<&mut Self, &mut Self::Output>(self)) }ÁL”²“‚ÆÅÇÙÔÚÙÚã^ü¬¾1ë^Ùã^#¢™ã^.¢™ÜÝÞßÛÜÝÞßÍìë^ÔÛ„±ï™Ô¾ç™„šÞÜßÝÆüÙSP This type MUST be `Self` with the `'static` replaced with `'a`, i.e. `Self<'a>`Á4¶ÙÙü”+üÇPM This method must cast `self` between `&'a Self<'static>` and `&'a Self<'a>`.Áœúܤ # Implementation safetyÁÄúüÌRO If the invariants of [`Yokeable`] are being satisfied, the body of this methodÁü£XU should simply be `{ self }`, though it's acceptable to include additional assertionsÁ|€ if desired.ÁL— Ôë^ Ôï™ÙÙ
Üë^ÔüŠ")üÅHE This method must cast `self` between `Self<'static>` and `Self<'a>`.Á úÜš ¢›º úü RÓ›ü™!X¯œ|ö!|"ë^ï™ÙÙ
Ýë^Ô$"ü§%+ü¹"?< This method can be used to cast away `Self<'a>`'s lifetime.Áý"úd…#ò^#úüž#VS The returned value must be destroyed before the data `from` was borrowing from is.Áù#úÜ$¢›¡$úü©$RO A safe implementation of this method must be equivalent to a transmute betweenÁü€%" `Self<'a>` and `Self<'static>`Á$±%ï™ë^ÙÙ
Þë^Ô÷$¶%ü©K¿üØ%XU This method must cast `self` between `&'a mut Self<'static>` and `&'a mut Self<'a>`,Á¼µ& and pass it to `f`.ÁÑ&úÜÙ&¢›ù&úü'_\ A safe implementation of this method must be equivalent to a pointer cast/transmute betweenÁüå'@= `&mut Self<'a>` and `&mut Self<'static>` being passed to `f`Áª(ú¼²( # Why is this safe?ÁÎ(úüÖ(PM Typically covariant lifetimes become invariant when hidden behind an `&mut`,Áü«)LI which is why the implementation of this method cannot just be `f(self)`.Áüü)gd The reason behind this is that while _reading_ a covariant lifetime that has been cast to a shorterÁüè*XU one is always safe (this is roughly the definition of a covariant lifetime), writingÁüÅ+]Z may not necessarily be safe since you could write a smaller reference to it. For example,Áü§,c` the following code is unsound because it manages to stuff a `'a` lifetime into a `Cow<'static>`Á-úô—- ```rust,compile_fail,E0521Áܺ-üÀÌÚ-˜„ø-
struct Foo {Á¤. str: String,Áü¦. cow: Cow<'static, str>,Á,Ê.‚ÆÔ.úüÜ.&# fn unsound<'a>(foo: &'a mut Foo) {Áü‡/ let a: &str = &foo.str;Áü«/=: foo.cow.transform_mut(|cow| *cow = Cow::Borrowed(a));Á,í/‚Æ<÷/Åǃ0úü‹0da However, this code will not compile because [`Yokeable::transform_mut()`] requires `F: 'static`.Áüô0`] This enforces that while `F` may mutate `Self<'a>`, it can only mutate it in a way that doesÁüÙ1fc not insert additional references. For example, `F` may call `to_owned()` on a `Cow` and mutate it,ÁüÄ2^[ but it cannot insert a new _borrowed_ reference because it has nowhere to borrow _from_ --Áü§3jg `f` does not contain any borrowed references, and while we give it `Self<'a>` (which contains borrowedÁü–42/ data), that borrowed data is known to be validÁÍ4úüÕ4ZW Note that the `for<'b>` is also necessary, otherwise the following code would compile:Á´5úô¼5««Üß5üÀÌÿ5˜œ6·¦,µ6æüü¿6*냤î6‘¬„‡7
num: u8,ÁÌœ7 cow: Cow<'a, u8>,Á,º7‚ÆÄ7úüÌ7/, fn unsound<'a>(bar: &'a mut Bar<'static>) {Áü€8HE bar.transform_mut(move |bar
öûˆ«E4öûˆ¡|àŽ„öeüŒW|²IüÄĪýþþýûÈ É‹É ÌÿÙà7ÿ¤ç
à7ÛÆÛü¦"¶Ûé!æ7ÄÛ<€¦7ëüÜ 0ü\Y Construct a [`Yoke`]`<Y, C>` from a cart implementing `StableDeref` by zero-copy cloningÁüð=: the cart to `Y` and then yokeing that object to the cart.Á²úüºYV The type `Y` must implement [`ZeroFrom`]`<C::Target>`. This trait is auto-implementedÁü˜\Y on many common types and can be custom implemented or derived in order to make it easierÁÔù to construct a `Yoke`.Á˜ú¢¿²ú¬º Attach to a cart:ÁÔúÅÇÌèÉŒœ†¸ˆžúü¦KH let yoke = Yoke::<Cow<'static, str>, String>::attach_to_zero_copy_cart(ÁÔö "demo".to_owned(),Á4• ‹Š  úü¨ # assert_eq!("demo", yoke.get());ÁÅÇÄã æ7¦7üü
à7æ7º
<closure_kind>Á<closure_signature>Á<upvars>Áà7æ7Ã5 ÆÛà7Û³4¬Âg"\â‰"‰"""ÌŽ”˵"üåI#ü­GEB A type with similar semantics as `Option<C<T>>` but with a niche.ÁóGúü÷GJG This type cannot be publicly constructed. To use this in a `Yoke`, seeÁüÂH/, [`Yoke::convert_cart_into_option_pointer`].ÁòHúüöH]Z [`Yoke::convert_cart_into_option_pointer`]: crate::Yoke::convert_cart_into_option_pointerÁ¬ðIŠŠˆv †J˜vœ–JË1H_}öáf@Œ((*´’L,L§ ïíe¼îËè¿*ƒ2Ì®LL®L»8Fu\»Ÿƒ2(ÝIŽŽˆvè¿cƒ2†J˜vö¿c¸âHË1ÀcgiÚÛÜ ÚË1 Û c cˆ¢cµ
 `£cÏË `àB¤GS
ÜöÌÝI
ƒ2±ÜœüÊRO A cart that can be one type or the other. Enables ergonomic polymorphic carts.Áúü¡TQ `EitherCart` enables yokes originating from different data sources and thereforeÁüöUR having different cart types to be merged into the same yoke type, but still beingÁüÌ85 able to recover the original cart type if necessary.Áúü‰OL All relevant Cart traits are implemented for `EitherCart`, and carts can beÁüÙ&# safely wrapped in an `EitherCart`.Áúü„EB Also see [`Yoke::erase_box_cart()`](crate::Yoke::erase_box_cart).ÁÊú¬ßÝúÅǤéÉÙüþ! use yoke::either::EitherCart;Áœ ¸ˆ´úü¸)& let y1: Yoke<&'static str, Rc<str>> =ÁüâOL Yoke::attach_to_zero_copy_cart("reference counted hello world".into());Á²úü¶^[ let y2: Yoke<&'static str, &str> = Yoke::attach_to_zero_copy_cart("borrowed hello world");Áúü™ MJ type CombinedYoke<'a> = Yoke<&'static str, EitherCart<Rc<str>, &'a str>>;Áç úüë QN // Both yokes can be combined into a single yoke type despite different cartsÁü½
63 let y3: CombinedYoke = y1.wrap_cart_in_either_a();Áüô
63 let y4: CombinedYoke = y2.wrap_cart_in_either_b();Á« úü¯ ;8 assert_eq!(*y3.get(), "reference counted hello world");Áüë 2/ assert_eq!(*y4.get(), "borrowed hello world");Áž úü¢ QN // The resulting yoke is cloneable if both cart types implement CloneableCartÁÄô  let y5 = y4.clone();Áü
2/ assert_eq!(*y5.get(), "borrowed hello world");Á
ÅǺ à ï°Ž€´Ã2ö\ŸÑ€ƒ4Ô‹3Ã2˜‘3Ã2LNQS§!§!
‹3‘3§!§!‹3Ã2ÍóÀ‹3ù!ù!
‹3‘3ù!ù!‘3Ã2¾ôË3(
Ñ
 º šÃ šï|Ž€{Ø‹3
°Ø3
´Ã2œÙœ´·»¾ŠŒÝ ÝÃ2Ã2
Ñ

œ33ÝH Ø
!º žà ŸžŸï[Ž€ZÃ2hkor_c!º ¡à ¢¡¢ï·Ž€µß‹3‹3 °µß‘3‘3 ´Ã2£·ß£øûÿïñÞß ÞÃ2 ßÃ2  Ø
 
£‹3‘3R¹
Y ã
"º ¥Ã ¦¥¦ï·Ž€‹3 °‘3 ´Ã2§§ïòöùŠ¥à àÃ2³4¤ ã
¤
§33ö(
ç
#º ©Ã ªª©ï¯Ž€®¿c‹3
°¿c3
´Ã2«Àc«çêîñŠŒáâã áÃ2 â c cˆ¢cµ
 `£cÏË `àB¤GS
ãǫ̈
ç
¨
«335±<øÆ$Ô­­³4®¯°±²ÛÜÝÞß±¯°²ÒXù0þ¬¬³4øÊ$HÍä ä³4 ä³4Ô۬׬
¯Ô Øø¦(x©³4»ÿ¬¬
°Ô ¹ø* »ÿ³4¬¬
±Ô¼Ž øèthë Ô³4³4¬³³¬Íì¸ù¸8­´"¸ ´»ÿø·$´¸Ž‚˜"³4à¿
²Ô¸ ±Štv»øÆ$ÔÃ4·¸¹º»ÛÜÝÞ߸º»¹ÒXù0þµµÃ4øÊ$HÍå åÃ4 åÃ4ÔÛµ×µ
¸Ô Øø¦(x©Ã4¥„µµ
¹Ô ¹ø* ¥„Ã4µµ
ºÔ¼Ž øèthë ÔÃ4¸³4µ¼¼µàùò8­½"¸ ½¥„ø·$½¸ê†˜"³4à¿
»Ô¸ ±Šqs»øÆ$Ô¿¿Ó4ÀÁÂÃÄÛÜÝÞßÃÁÄÂÒXù0þ¾¾Ó4øÊ$HÍæ æÓ4 æÓ4ÔÛ¾×¾
ÁÔ Øø¦(x©Ó4¾¾
ÂÔ ¹ø* Ó4¾¾
ÃÔ¼Ž øèthë ÔÓ4¸³4¾Åžàùò8­Æ"¸ Æø·$ƸƋ˜"³4à¿
ÄÔ¸ ±Šqs»øÆ$ÔÈÈã4ÉÊËÌÍÛÜÝÞßÌÊÍËÒXù0þÇÇã4øÊ$HÍç çã4 çã4ÔÛÇ×Ç
ÊÔ Øø¦(x©ã4ÝÇÇ
ËÔ ¹ø* Ýã4ÇÇ
ÌÔ¼Ž øèthë Ôã4¸³4ÇÎÎÇàùò8­Ï"¸ ÏÝø·$ϸ¢˜"³4à¿
ÍÔ¸ ±Šqs»øÆ$ ÔÑÑó4ÒÓÔÕÖÛÜÝÞßÔÓÕÖÒXù0þÐÐó4øÊ$HÍè èó4 èó4ÔÛÐ×Ð
ÓÔ Øø¦(x©ó4¹’ÐÐ
ÔÔ ¹ø* ¹’ó4ÐÐ
ÕÔ¼Ž øèthë Ôó4¸³4Ð××Ðàùò8­Ø"¸ ع’ø·$ظþ”˜"³4à¿
ÖÔ¸ ±Šqs»øÆ$
ÔÚÚƒ5ÛÜÝÞßÛÜÝÞßßÝÜÞÒXù0þÙÙƒ5øÊ$HÍé éƒ5 éƒ5ÔÛÙ×Ù
ÜÔ Øø¦(x©ƒ5•—ÙÙ
ÝÔ ¹ø* •—ƒ5ÙÙ
ÞÔ¼Ž øèthë Ôƒ5¸³4ÙààÙàùò8­á"¸ á•—ø·$á¸Ú™˜"³4à¿
ßÔ¸ ±Šqs»øÆ$ Ôãã“5äåæçèÛÜÝÞßèæçåÒXù0þââ“5øÊ$HÍê ê“5 ê“5ÔÛâ×â
åÔ Øø¦(x©“5ñ›ââ
æÔ ¹ø* ñ›“5ââ
çÔ¼Ž øèthë Ô“5¸³4âééâàùò8­ê"¸ êñ›ø·$긶ž˜"³4à¿
èÔ¸ ±Šqs»øÆ$ Ôìì£5íîïðñÛÜÝÞßñïðîÒXù0þëë£5øÊ$HÍë ë£5 ë£5ÔÛë×ë
îÔ Øø¦(x©£5Í ëë
ïÔ ¹ø* Í £5ëë
ðÔ¼Ž øèthë Ô£5¸³4ëòòëàùò8­ó"¸ óÍ ø·$ó¸’£˜"³4à¿
ñÔ¸ ±Šqs»øÆ$
Ôõõ³5ö÷øùúÛÜÝÞß÷úøùÒXù0þôô³5øÊ$HÍì ì³5 ì³5ÔÛô×ô
÷Ô Øø¦(x©³5©¥ôô
øÔ ¹ø* ©¥³5ôô
ùÔ¼Ž øèthë Ô³5¸³4ôûûôàùò8­ü"¸ ü©¥ø·$ü¸î§˜"³4à¿
úÔ¸ ±Šqs»ø Æ$ÔþþÃ5ÿƒÛÜÝÞ߃ ÒX ù0 þýýÃ5ø!Ê$H!Íí íÃ5 íÃ5ÔÛýý
Ôø!¦(x!©Ã5…ªýý
Ôø!†* !…ªÃ5ýý
Ô¼Ž !•ø!èth!ë ÔÃ5¸³4ýýàò8!­"¸ …ªø!·$¸ʬ˜"³4à!¿
ƒÔ¸ !„±qsø"Æ$ÔÓ5ˆŠŒÛÜÝÞߌŠX"ù0"þÓ5ø#Ê$H#Íî îÓ5 îÓ5ÔÛ
Ôø#¦(x#©Ó5á®
ŠÔø#†* #á®Ó5
Ô¼Ž #•ø#èth#ë ÔÓ5¸³4àò8#­Ž"¸ Žá®ø#·$ޏ¦±˜"³4à#¿
ŒÔ¸ #„±qsø$Æ$Ôã5‘ÛÜÝÞßX$ù0$þã5ø%Ê$H%Íï ïã5 ïã5ÔÛ
Ôø%¦(x%©ã5½³
Ôø%†* %½³ã5
Ô¼Ž %•ø%èth%ë Ôã5¸³4àò
â9ç!NµÅÚßåêü°ÌüKBox<T>Áalloc::boxed::BoxÁ alloc::boxedÁ¬Û¼Àalloc::borrow::CowÁ
alloc::borrowÁRc<[u8]>Áo std::syncÁ Option<T>Á Yoke::get()Áhttps://docs.rs/zerovecÁ¸ÑÃÑ Cow<'a, str>ÁúÑ‘ÒoÀstd::sync::ArcÁ´ÒÂÒZeroVecÁàÒ¸Ñ.get()Á
Yoke<Y, C>ÁˆÓúÑArc<T>Á®Ó´Ò alloc::rcÁÍÓàÒÑ Yoke::getÁåÓðÓˆÓRc<T>Á‹Ô®Ó
alloc::rc::RcÁ¢ÔѤÍÓÁÔåÓðÓÙÑáÔ‹Ô¬£Ò÷Ô¢ÔÑŒ¤ÐÒÁÔÃÑÙÑáÔ¬À‘Ò£Ò÷ÔoÂÒ¤ÐÒ-ÑSelf::into_rawÁSelf::drop_rawÁš#&Yoke::convert_cart_into_option_pointerÁœ®[-crate::Yoke::convert_cart_into_option_pointerÁ crate::YokeÁÀstd::ptr::read_unalignedÁÚÑstd::ptrÁ¾ÖÑÖš#®[œîÖÀ§×Ù׌ÚÑöר¾Ö®[š#ÑÖœîÖ§×Ù×ÀöרÚYoke::erase_box_cart()Ácrate::Yoke::erase_box_cartÁÑÙ××ÙòÙÑÙ××ÙòÙÙ׌ÑYoke::map_projectÁYoke::map_project()ÁÐÒSelf::wrap_cart_in_either_bÁSelf::wrap_cart_in_either_a()ÁYoke::try_attach_to_cart()Á¬Û¼Yoke::with_mut_returnÁYokeable::transform_mut()ÁýÙYoke::new_always_ownedÁYoke::attach_to_cartÁÐÒ.map_project()ÁâÚSelf::wrap_cart_in_either_b()Á–ÛYoke::into_backing_cartÁ‚ÜœÜYoke::new_always_owned()ÁÄÜßÜþÜYoke::try_map_with_cartÁ—ݿ݂ÜçÝYoke::attach_to_cart()ÁßÜYoke::try_map_project_clonedÁ–Þð#r—ÝYoke::try_attach_to_cart_badlyÁ¿ÝYoke:: wrap_cart_in_optionÁçÝÊÞYoke::map_project_clonedÁëÞ–Þð#r¡ßÊß0https://github.com/unicode-org/icu4x/issues/1061ÁÊÞõßëÞð#ré! Yoke::try_attach_to_cart_badly()Á¡ßYoke:: wrap_cart_in_option()ÁÊß#1061Á³àõßYoke::attach_to_cart_badlyÁáYoke::new_ownedÁ¸á®[Yoke::try_map_projectÁßá³àõáášâ¸á_®[.https://github.com/rust-lang/rust/issues/86702Á¹âßáYoke::attach_to_cart_badly()ÁõáYoke::new_owned()Ášâ_#86702Á®[åÓ€ã¹âSelf::wrap_cart_in_either_aÁYoke::try_attach_to_cartÁ¿ãYoke::with_mutÁæãÑ_Yoke::map_with_cartÁÁÔåÓ†ä€ã¬äÌä¿ãYokeable::transform_mutÁïäæãÑ$stable_deref_trait::CloneStableDerefÁçšåÁÔåÓøÚ†ä¶Û¬äØÛÌä¬àåßïäýP–"ÑŒ’æÐÒçÁÔâÚøÚšå–Û¶ÛØÛ¬œÜàåýçïÄÜ’æþÜ#[derive(Yokeable)]Áyoke_derive::YokeableÁÃSelf::transform()ÁàåßýSelf::transformÁ¤èœÜ¼èPßèýÙÃàå‰é¤è¼èœÜÃýßè‰éàåœÜÑŒ«EÑ«E
«E4ÑÙï
ÃLðìŠ  غãàéæ³Œ""“""Û Þ ã ŒMÃMÐLÇLùMÌìÍì“íµßíßï ÃLðìŠ  غãàéæ³Œ""“""Û Þ ã ŒMÃMÐLÇLùMÌìÍì“íµßíßïé!ÃLðìŠ  غãàéæ³Œ""“""Û Þ ã ŒMÃMÐLÇLùMÌìÍì“íµßíßÙé!ïÃLðìŠ  غãàéæ³Œ""“""Û Þ ã ŒMÃMÐLÇLùMÌìÍì“íµßíßÙÃLðìŠ  غãàéæ³Œ""“""Û Þ ã ŒMÃMÐLÇLùMÌìÍì“íµßíßÃîVbªàXrÑhc(B}wÀŒ¦«ÆÍë¨Kv$øePIKÅj–þ¢˜ÀÃJÓ˜ÍoìQZßP!=TÞ8 å!ûñöˆb
y 1'B z“™h?7dîw·²†ø"ßt.z´u;–ʆT今õŠ)”›©Jr{cÏêOý¾ }Ô;‚0fz[ŸŒ”DÖëP¥DMÑük¸_“
Åë@1㨑‹¥ç½„"ÚjC.N„)]PÊ1 צOœQmª¶Fú-y, Žš£q:‰Ý—%‚Ý«›˜°¬O\s=ñô¡¨<q¨þÑ|òFe¬;bnY®¬†ÉÍüˆ‡~‚‡N4@Ä%v¡È·|†(øu4H@7ú¸Y½yk¾¸rióÈK»7‰$×î§.*?eÏ~c }
{(À¼‡kÌtW—/Œ±ØkÑÎüÛ-f2­:IÐPl@Næ_’õWÛ_~b8ëÖmV+xKQ•êµNNÎÒÇØÁꌓ­r“ZQdp‰9ãek ÓR›×ÈŽ¯³»¤
UH×T2;®ˆ ×ìRöÃÆ~´¶Œ<‡¯npþÄ—pÅ;Ë©ÒØ¶„ùÆo4[ùp ½¥ü¢Bƒ=~h
˜“ŠøÛjaÉ4~{ Æóv›Ç°ï ;‹²ª?Ññe\4Šš%œ
\ŠÆµ*y÷ˆT4G˜«Àhª×BãÒÛûpÜQ¶çíP‡æv¤Yûí¾›·yjß™±U_¤4?%º¾ÞÌÉ”êe·§ ! ‰_S5UëyXzh¥Êúù@Qz¯îÁåF#>…¸dó¿,YWNÈýŠáLCd|lÝj¦b­w=_©2—܆–'ð«ç¢(é5S{žÕ˜ù!OŽ´¤8ro¦ |K¬[Z` ˆEº\Qêóèþà ‚ò%H¹¤…3õ-q &]·Ý;[3—7NËõŸ“>ÓË|  ÍÌÏ" |ñ—Ý®ó{t—àà¥WªºÓ–+ƒT#ëHÔº†•Îz„ÿP>yŸ¸öRÞÉŸHŠlÚ)ºE,Dåj/é×±-—K×ûö}×|·tbéWË&«ñ S^p~bü2$2é¦u…¨l¿|Œ¿£B`Ϥ‚¼“K±î Lmð4Ç–ÀšLG[jj~mMã§(üO˜SKËpS+µÃ¦™ù×Üâ?–É×Ȳ¬‡Êæö‚ŠÙ\–GÇæ0ÑUj4ÜÔ& æ°wåÛ/B+ºm`Šª•®ÒíÖ³v]éówBfšC3ÿÔÂk00îºMG$‚ÜÁxèÅ×#èöFèF&˜4ØÙ§´…uñ-­àã0G°æÚï½ôci? «Ýì/ á5¸·}Ïÿ!h&éé
¢ù4m.§²zÖ¼TdåÿÅzª)=åF´G–~žä†ÚµPÙÏ3€¯åhíH-m4«Z}`)5¶‚8hw.»r&¢¢ªn`
C%qèÒdÃÂ}ãXÌÞ!Ú™ ×r„©šeÑíµKò,”=
éìT¾«0T12î¬n. i"gšY€PÆ)v¥1šIC·ÇV^ ·{™òê³h@·¿×:¸›âרÚ%J¶)è§îÑ`ÙÉóîO=œáÕ0ĵf%¢9‡‚úÀ @Êˈâݯà>ÎZu v÷·Âƒ N›`]lÑÆŽ¬Ž­Ÿ‘J*S¼Þ¹é®ÿ0Ï,<:pLÔâ“%íÕ„Œc :a>„ÄÏ€q*
«9H“Ci #O
ÃH‚ÈŒO‰I¦ƒ‡½Èg%ž¾úLñ¾
[L±¡÷)è’éA—8"b³³¯™Ñn?#¨,‰ê^àš4@Ó—Å/áU.˜sJo üœ'‰6E0ʰNýPK/B`mÙ=ý.Ëj*D
±õÅ:­aEu×8g0q…'œPðtD¹sÚ3
Òñ©¸ÿB‚²-m™‚I“!”¼/é†J¥ÛÜ+%Þ—ÁÓ©(³V3áÀr]¤L €3GЖMGçÈtIFÚPoï¸ø‰ã7¡±©3«µììÑxHs¤òõzØIÙ÷°º"/fÞ²>sK6ÝÎÔÕrö'#…–„¦wÚAZokWh¯ýæÃ£h}ƒqÓ­(Í/'&oX’Àeg1È׬²$@N
XÿÀo•a±8Ь÷34€oË)¡ˆü'S³(Ý…æÌMa÷˜BWi£Uƒ"K®ŒÆ“2và|lRÁ>,3g)‡gs7¹éZ}1c=…dÛÏz‡¯íHLj‹H_ø‘=õR5›E–Ë"„˜¨AÉP¸.+§‡þDÈa æ÷CÐ¥›*-òh/£­ÎýS‰ÇŒ[Gì} /TAºm:§í˜43™¦ÿÚá©v 8TžâWˆÜ¼¨b§wù„ó‰™×Éáy5íþž|!åÒÑ­§ÀÎHÊŸtâ¦ÇSÏüúÕUD=Îáãµê22KQSÛ2ç—¦Gè>Àò‹eëu!Â_{ü£øñÂçFfä¦i†ÊÍüwRÓ Ò‘Çv×ú}6§9˜Xâ#u®€&IOG¥„ºÍ<V•ÌÜГbuW¶yÖÿ“ý‰O®é
7¸Uåš¾³SŸâ¸DeÔoŒëÃF޾§Þ,5Í#°íâsA~þa½p8˜&fû3δ¶É9Ä»8äÇš°”mÊ6éÞ/ìø:”õ,L³ÞßÝOJŽãû×f´Y¼g5Q1EPâÊkÉêzi&·hd}“âÞFõ{ 4F
¨RÅsU¤,bZ9,aWùÖTœæå]Â153Åëµè& æO~~‡_*õK%
Æ0hNžŽ&¬}ù…øpÙÙ‡òíbw@´Ä?T·OÜÏ\=€ffGšÉt'ßþ›ÙöýÉ»áÁÛÆn€‚îBÇCN¡q
\ËùïõðwžÖã}ìÉšMçýÔ”êz Wü†Õ×ö'9£4‚_¨¤ÿÇÑÿôÊ¡'r阽Ysò&
¸ Ù4ÔE#‡ÙwÝßgØA£´c{?0‘N­j©½œ=Á½õHrÄcÌ$ÀìN»` |hÊ~ÿØ«œêä}¬myD¸ë´ÆÙ>Û¡ní·+yh.ü©lqÿmp\Y2cpB|zŒË-nßZ{þ{ókWÀeôl=)ùu—Z–ï½™öËëo áÑ’M3§Šˆû¿»ºsCîÓ”[þõæ²ùSi1–󨬤Ðͬ';®>r¶ºÑ8pÙŠúŽÿ›™‹#`ŒÈ£`Lz·ÜÊH‚
F/‰ÙA”ûŒ§Ä¡¢iãJÊ•ÁÅò‡(†Kv qØÎu^{¹Kô¡öl““ùœNÌA†25P¿)9‚“2¾
Ó "¨³1üJ).áÏÊr„cÆ“´ÀiîŠaÞî—˜&Ð]“œ« FPÐøE=–·ÏÑžs<ìÈéÒgû(<duøÞÛ1jw¶ð{$ Fó´à×¾[¢+[7ç½/–ãïŸ ß8Å͸Ú|Ùr¦ÊüvÁÝÍŸ
î—UØ3u¤Ìf4ÿô!X†n“Ü9˜·NøBÞÑjPÒÃñÝÿŒ0'Øã³œ€üÕçg32€ˆ¨E/]\\ÉZ<œ$ÍJ¦ïЩյЗé銻8¼ðÍ ôÅæ‚ÒHUs‘yˆàÉø@4Öi•„9L|B
¶¨>›7—Ê;®kÊÂð,üÞ~ËÛä/£ëvf:!j¼®ZHŠñøs‹hß}”XøÌ)¬Ý9éÙ”IjEhp” <K—àçÝÜ-F
Ò8)t¿Ü–¹€ ¸¯ AV_!™!$GGÄ ÉŒ>P^ÝQ,ïVi4ãÔ×ùitNI¥3šWr°$ÔS_;
[“œ¿WNçÅlâoûi?ëMÏûJ²Ë8z#¹‹ûÕ:†éçþ×w‡½²%2¾ý{RÕ[âÖøÐjé¢U‘sòÓ¶½Ž3;ak·ÅqßòtN*¯v¢*@’ÆšòôÞžF8~rëŠò(-Rý—

[5t‡:K7î]Þ õÁރ╖ ­Q’«i˵%¥}qV]Ùô5 /v,À™H¶(L\«z R”‘ðîÐ1Q0Òs›s[éÏSª:ÒüŽfGT)°Ögü KJMÝÔÀ˜l®ª%7Ü]F¶
(rÝÑAòR²ÍÍT÷.ëŒñ ~:¿U´gQß©™ÈÀFhÌVVö˜ö++Õô€V”€bó<s×Igœu{}„™N XÃwÄ­íº5 ö‰ÞuXÇVý=(Ž,Þ8•ë_ýÈXx\”S»M|ÿCôwÍ;„Ï)8„9:!ðÓ’ÖkP96#QÜíè%-àˆÅ`fŽßéIb33à† pï—s/W¢CNLÉåßÙ£ƒ‚£~îýæðQa{]'¼A™Ä„ò†{žŸ„LΰÊ)÷„ š”©
¥+Ä»ª‘wb@Ƕ>s•óVdHpÇãÕ5>„ú‘,žDAQÑÍj6îµD--Ƽ å–f Tµq5ÆÚɨãçh¡!p™òW‘Q P»ùz| {{Ù•GþˆÒ‡·âÖ½½wR>Â>e3*Ÿx}÷õŒ1D¢¼šqådsJñé[‘ ™éñØHœÎÚŠ¥äÿv 1*¢j;‚}€JÍqǯ@ÇQXƒï8m~žlU–Mîœs8tЯ]šøÔ9ߊb0amìÆ•”RzC4"I×dbmto.W]$ù¢àŸ`'©$(dó}B p¯´êè‡-kš¾: 8_ä~›ÅlµÜãÕõе)¾n›ð“†ö’ûwÓ!&¨-WnÀæZ»P_ Óh8geÎcû²¿9²PØ@NU"FZs»9¢¶[^3l5óòyúESöÆi¯'y鶸“Yéh>XU÷´Ÿ¢;j³Zÿö–~µ’«úwKcGííÊ|]k¨Âw7{ Øw¹N» ä߸e†BöëÑDÞoôfäuR8M·“\pácˆ#îȉkùÛÄ~#”¢ªÝîTOÕ'ïüÙjñƬiI~ ¢Váߊ?òŒ¿P,øƒÈ¦IŒ„=µ8¼A-g椹æ’|,
´¡˜¡Å¦È&E|b´Ü4›ÈÛxLI;$!ÕäóÖõ©HÅ‚iÄu†6µ=D'A*áSÖ01æ7a¶{fáë÷øƒÚEˆNI.m¯|>`CŽ.fòŽ`p€eW&J•Ó s¨Ü=D¦rvKÅxPœ¡ºü÷–÷,©×³–z܇þeqÛÇŽÞ(–Ì’Ô/Ô˜ËZ¦W‡6sO­áÍÄÞ˜ŸL`aI¼j Œ&ßß ¨ºÒAAƒÊôm8Ó¾ÛÃx¯Dãw 2 ™ÞÀÇ^À¬pö-äÌ+°Eÿ?ƒíÅù~.i@3 «Z£4ÅEœ¹}%ÅgÍCÿßàeÁÉtÖédt
.v+ÿ:<îŒãåpç[f±³Ç›üáŒêÍ­{(/d˜=9Æð”õ…¬ ÿÓØgÞ(ÂêëÆ!²‘È×J} GhÅr ÔèW¤Pzó†ƒùC 2<Ñ»Óv¥¥™×‹%¿+E¼$ysúÄ•ã|œŠâOåôÄÅÂ÷»sŠC% 8®³ ~žj€EíK±z—²ÉG²1ÑâwÒ@žþb¹”ÿ§„Iþb5øqE hý³ÉÒ©mAÐåáPQ°0Rïgt
9ØŸŠ…š
·JuÖ