Files
boc/aamos-ledger-rust/target/release/deps/libscopeguard-80f335d46863d1e6.rlib
T

81 lines
29 KiB
Plaintext
Raw Normal View History

!<arch>
/ 0 0 0 0 8 `
// 70 `
scopeguard-80f335d46863d1e6.scopeguard.bb8ffa1e542a62fe-cgu.0.rcgu.o/
lib.rmeta/ 0 0 0 644 26896 `
ELF·g@@GNUÀrust
Ae#rustc 1.96.0 (ac68faa20 2026-05-25)ÁíàÄTËŸ ÜJîÄ)'ß\¥!-3d1337db07d0b3aeÁ¤°ð ¾ä-±($²ï=©Ã-7e98a21bfd32b0edÁOnUnwindÁDÀ6»use_stdÁœ6 OnSuccessÁLà7»žœ°7defer_on_successÁ„§?»žœô>defer_on_unwindÁ|²B»žœÿAguard_on_successÁ„”[»žœáZguard_on_unwindÁ|öb»žœÃbtestsÁ,¤n$™níÀStrategyÁ 
should_runÁ
¾deferÁ
ScopeGuardÁ¥¤»dropfnÁstrategyÁ¥¤
with_strategyÁ
into_innerÁ£¥ ¥  ¤$¥$$¤$å$´*¥**¤*/¥//¤/ã4¥44¤4×AlwaysÁ:×)
.
3
8
8
8
;
;
;
 ¿c9œœX¢Û à æ» dBçQ¡;CE¥¤é!ö!Œ"¿c:94
9 $*/¿c# 
 é!ö!Œ"(5;Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ŸÈŸÈ ÈErrorÁ O˜éBL à¡  c cˆ¢cµ
 `£cbufÁ `àB¤GS
çð±ý$Å8Ï8ü£8,$¶8
¤¡MÍÑ4@…ùA ×ÛÃý»41@ ÃÛÃ
ë4@ÌËMQN ×ÛÉK ÃÛÉGüM‘ ÃÉÏ÷ PhantomDataÁFu\»ŸÏÏ ‘N˜NüºLÞýƒ4o@¼Ã2ý°_AàÃ?+¼É'àÉbœãLà ÏLÉ4ÕLÃÛÃÛ ManuallyDropÁÅÛ»¬µÜÀ,%*ÃÍÃÛÃÛ¼ÅÛ»¬µÜÀ,%*ɵ×Û×ÛØÛ
MaybeDanglingÁÚÛˆÙ @€y,¸·Â¦ÃI×Û×ÛØÛ¿ÚÛˆÙ @€y,¸·Â¦ÉÁ!É —N L‡UÊÈ ×ÛÆ ÃÛÃ,ÎUýàÕ%N ×Û×ÛØÛ¿ÚÛˆÙ @€y,¸·Â¦°®ÃåR@  ÎõùÉýÒR'@ æ
®ÉE$ ðWüâS•
øR@ ,âW2 öW÷W?üƒUôüÊU§¼Ä“UàKýâT9@Å\âUý”8AáEU@.ÅÃdáU*áÃ&ý¨ÃåNÝÃÄÖUýêVE@ÈdÇWýÙDA
âE¡W@
ý‰Pø@ÁÉü¯W%0 âÉEðR@ à „T,ôSÃÛÃÛ¼ÅÛ»¬µÜÀ,%*šÃZ©
sÎs É £f£Ó»ØÃôÐ$
£«´ ×ÛÃÉ ÃÛÃÆÄ«´ ×ÛÉÏ ÃÛÉëÇ ÃÉàdî Fu\»ŸààºÁâYüÞX„ÃÃÉàü¼Y$ӼãÑàëù¼Éô÷àɫ滠dBçQ¡;CEÃÉàÄ…Yà ñXÉ4÷X°£õô®«ù«Á59
É,=¿A°®Ã¾g)üŒg2ÒÅÃ\­gÏáÃÌ ÃŸg ,•g XA°®Ãâh.ü hBþÈÃ\ÑhûâÃø Ã4»h L­h X °®ÃõùÉ,Õj d4Üj d|±k
d
Ï$*
4Ïk dlÏk ,Ök
 d
. 
=d
™"ÉÃ ^g Ûk
  æk ìk
ík#  üÀi­?O _uu ƒ3lüÐj×ÅÃ\ûjÔáÃѬÝüðjÅÉd”k
áÉ
åÝÉĉk
©
ÒiLÈiÃiÉKÃfÉ4:©
äÉî ôÃô|ƒ^»Ë±|Ôžå Fà ¡kÉÌÃÒÉØÃÞü£m& d
÷c £md
°²mü¥m$JdæmÕ°®Ã" ¿cü£mPd
Ù`°dÂ%<Ýmmä×m òmü£mfd
à`hDn Žnn8üäl«@ ÅÃ\çm= áÃ: Û \m,ëlè
òl Í`Í` DebugStructÁÐ`×µ`Ñ` µ`Ò`
has_fieldsÁµ`ã¹q·Ù›ß¨>ÿ'Û(ã”&ö¸š±žïª%ö”&ͱ&þ&N 9íÀÍ0×Ü0 `î \ò0î ¼d1ÃÛr,ª1é!DerefMutÁD±1ö! µ Å1
Ú,±<üò…ütEB A scope guard will run a given closure when it goes out of scope,Áüº$! even if the code between panics.Áüß$! (as long as panic doesn't abort)Áútˆ # ExamplesÁú”› ## Hello WorldÁ®úü²@= This example creates a scope guard with an example function:Áóú ```Áäÿ extern crate scopeguard;Áœúd  fn f() {Áü­0- let _guard = scopeguard::guard((), |_| {ÁüÞ*' println!("Hello Scope Exit!");Á\‰ });Áúü™! // rest of the code here.Á»úü¿OL // Here, at the end of `_guard`'s scope, the guard's closure is called.ÁüMJ // It is also called if we exit this scope through unwinding instead.ÁŒã # fn main() {Á
# f();Á # }Á<ÿ,ú|— ## `defer!`Á§úü«<9 Use the `defer` macro to run an operation at scope exit,Áüè?< either regular scope exit or during unwinding from a panic.Á¨úÿ,ü´0- #[macro_use(defer)] extern crate scopeguard;ÁåúÄé use std::cell::Cell;Áú|† fn main() {Áü–QN // use a cell to observe drops during and after the scope guard is activeÁüè(% let drop_counter = Cell::new(0);ÁL ü› HE // Create a scope guard using `defer!` for the current scopeÁ¤ä  defer! {Áüù 96 drop_counter.set(1 + drop_counter.get());Á
Á
úüÅ
:7 // Do regular operations here in the meantime.Á úü„ 96 // Just before scope exit: it hasn't run yet.Áü¾ .+ assert_eq!(drop_counter.get(), 0);Áí úüñ KH // The following scope end is where the defer closure is calledÁ üÇ *' assert_eq!(drop_counter.get(), 1);Á Ê0 ÿ,
úì„
 ## Scope Guard with ValueÁ¢
úü¦
JG If the scope guard closure needs to access an outer value that is alsoÁüñ
PM mutated outside of the scope guard, then you may want to use the scope guardÁüÂNK with a value. The guard works like a smart pointer, so the inner value canÁü‘52 be accessed by reference or by mutable reference.ÁÇúüË  ### 1. The guard owns a fileÁìúüðOL In this example, the scope guard owns a file and ensures pending writes areÁÌÀ synced at scope exit.ÁÚúÿ,äæ-ƒúœ‡ use std::fs::*;Áü› use std::io::{self, Write};Áü»96 # // Mock file so that we don't actually write a fileÁ´õ # struct MockFile;Á¬Œ # impl MockFile {Áü¢B? # fn create(_s: &str) -> io::Result<Self> { Ok(MockFile) }ÁüåEB # fn write_all(&self, _b: &[u8]) -> io::Result<()> { Ok(()) }Áü«96 # fn sync_all(&self) -> io::Result<()> { Ok(()) }Áˆ1üí! # use self::MockFile as File;Áúü“%" fn try_main() -> io::Result<()> {Áü¹-* let f = File::create("newfile.txt")?;Áüç1. let mut file = scopeguard::guard(f, |f| {Áü™63 // ensure we flush file at return or panicÁüÐ! let _ = f.sync_all();ÁÃ.üþ96 // Access the file through the scope guard itselfÁü¸0- file.write_all(b"test me\n").map(|_| ())ÁÊ0ïúî3äƒ try_main().unwrap();Á, Ê0¦úÿ,²úü¶85 ### 2. The guard restores an invariant on scope exitÁïúÿ,äû-˜úüœ use std::mem::ManuallyDrop;ÁŒ¼ use std::ptr;ÁÎúüÒDA // This function, just for this example, takes the first elementÁü—A> // and inserts it into the assumed sorted tail of the vector.Á //ÁüàKH // For optimization purposes we temporarily violate an invariant of theÁü¬-* // Vec, that it owns all of its elements.ÁÁIüáJG // The safe approach is to use swap, which means two writes to memory,Áü¬RO // the optimization is to use a “hole†which uses only one write of memoryÁüÿ" // for each position it moves.ÁÁIü©>; // We *must* use a scope guard to run this code safely. WeÁüèMJ // are running arbitrary user code (comparison operators) that may panic.Áü¶HE // The scope guard ensures we restore the invariant after successfulÁüÿ+( // exit or during unwinding from panic.Áü«.+ fn insertion_sort_first<T>(v: &mut Vec<T>)ÁÜÚ where T: PartialOrdÁüü  struct Hole<'a, T: 'a> {Áô v: &'a mut Vec<T>,Á̼ index: usize,ÁüÖ# value: ManuallyDrop<T>,Á¥9ú„ˆ
unsafe {Áü™ HE // Create a moved-from location in the vector, a “holeâ€üâ )& let value = ptr::read(&v[0]);ÁüŒ!TQ let mut hole = Hole { v: v, index: 0, value: ManuallyDrop::new(value) };Áá!úüå!.+ // Use a scope guard with a value.Áü”"GD // At scope exit, plug the hole so that the vector is fullyÁüÜ"! // initialized again.Áüþ"UR // The scope guard owns the hole, but we can access it through the guard.ÁüÔ#A> let mut hole_guard = scopeguard::guard(hole, |hole| {Áü–$SP // plug the hole in the vector with the value that was // taken outÁüê$'$ let index =
Ú
^ĸ0nD×0Äå0´ƒ1¹DŸ1ÌÌççDÀ1ú”‰2üË1=: Controls in which cases the associated code should be runÁD“2  Îìü‰2« ÖhÖh  Äš3ü¢2=: Return `true` if the guard’s associated code should runÁüä21. (in the context where this method is called).ÁT3 
ÞhÄî7à ¼£8T¦8

”¤<üó:0- Macro to create a `ScopeGuard` (always run).Á¤;úü¨;?< The macro takes statements, which are the body of a closureÁüè;+( that will run when the scope is exited.Á(|”<
 ·< Ž= ½< Ç<, ¾< ¿< Å<, À<8¿ Á<& Â<8¯Ã<
Æ<*É< Ì< = 8Ö<8_guardÁ4Ú< á<, ã<8,ä<'é<8£,ë< ð< „= ñ< ò<$ ó< õ< ö< ÷< ø< ú< ƒ=, ü< ý< €=, þ<8¿ ÿ<
=% …=% Œ=üðG'ü¦CA> `ScopeGuard` is a scope guard that may own a protected value.ÁèCúüìC=: If you place a guard in a local variable, the closure canÁüªDNK run regardless how you leave the scope — through regular return or panicÁüùDJG (except if panic or other code aborts; so as long as destructors run).ÁÄÄE It is run only once.ÁÝEúüáEIF The `S` parameter for [`Strategy`](trait.Strategy.html) determines ifÁô«F the closure actually runs.ÁÊFúüÎFMJ The guard's closure will be called with the held value in the destructor.ÁœGúü GOL The `ScopeGuard` implements `Deref` so that you can access the inner value.ÁTûG¥¤Íìà †HÍìÉ ‰HÍìÏTŒH"Éî L¥HÉî ˜"©
 ÏD·HdBçQ¡;CE3rtoql ŒHà´ÇH,ÇH°¼ãH4ãHõüÔI!DÔIà
üúIJ¥¤ÌuL©Jšu ‚Jªu …JºuŠu ÿIÞuD»J248:üºL<üËJLI Create a `ScopeGuard` that owns `v` (accessible through deref) and callsÁüœK&# `dropfn` when its destructor runs.ÁÇKúüÏKHE The `Strategy` decides whether the scope guard's closure should run.Á.\ªLlÁLÃÉ
ÃÉÏÁ!*üâS#üžNMJ “Defuse†the guard and extract the value without calling the closure.ÁðNú<øNÿ,ä„O-¥Oúü­O(% use scopeguard::{guard, ScopeGuard};ÁÚOúüâO%" fn conditional() -> bool { true }ÁŒPú|”Pî3ü¨P=: let mut guard = guard(Vec::new(), |mut v| v.clear());Á´êP guard.push(1);Á…QúÔQ if conditional() {Áü¬Q30 // a condition maybe makes us decide toÁüäQB? // “defuse†the guard and get back its inner partsÁü«R63 let value = ScopeGuard::into_inner(guard);Á„æR
} else {ÁüûR0- // guard still exists in this branchÁL°S¥9,¾SÊ0<ÈSÿ,TéSÃ