Files
archy/core/target/debug/deps/libfutures-8406e920f7b42733.rlib
T

72 lines
19 KiB
Plaintext
Raw Normal View History

!<arch>
#1/12 0 0 0 0 28 `
__.SYMDEF#1/12 0 0 0 644 17924 `
lib.rmetaÏúíþ ˜±D8±D.rmeta__DWARF±D82 ðEðE Prust
)C#rustc 1.93.0 (254b59607 2026-01-19)Á³VOÐêùÿ²?ÑL¼§Ì±-a7a40eb546f9e2b0Á futures_coreÁÍ[D¼ðˆŠIØÅßdt7-c161af05ee5b6d8fÁá\ƒ¦è3$|]åŒ[IÚ tæ-14b12edc9f8cd90bÁë&Gf·Ã ¬ëñq:¤»b-bb76018b1173caf6Áõ…·fÊ ¦%g--c48c539199cbc88bÁà 9m Ù„«ÐÒþá•cB;-030c5b0bba47cc8fÁrustc_std_workspace_coreÁÛ¹þÓ7>H%¸ÚÉ­-4b81d37a5530864dÁüÃùs<Uß7VyóHr#QÏ-c66cc7807550ce25Á miniz_oxideÁõFÖˆÚ™ª‹"ÞXzLVª-62cbc7af83058505Áadler2Á—wÉD‘嵯|6¨%Œ
+-2f171dd2394b4b62Á hashbrownÁ,ïcV¼¨ø¢:Ê\'È߈-9571ba9e0f6c7a90Árustc_std_workspace_allocÁ%¥Èxµù·¼5Ä3Bœ-aac566ad65903fa4Á
std_detectÁMmáýZ^9õ Îà§e˜÷e-2edb296e590136d8Árustc_demangleÁ@¼§VÉNb˜æ¨fHÌ+V3-53b132e4a2fa6e26Ácfg_ifÁfÝv.Å"ÒÜuPp¹ˆ¶-f76b385d7d4d7f3eÁ addr2lineÁÕú-WiúQVÓ¬
µT§5-fe25100bd73e48e4ÁgimliÁ¹xLáÇí÷‘o±Ñ8£Å-265ba9e6e4f70b3fÁobjectÁÔ³ÝzÓÿ¶ò°öM›¼òü`-9ae0d1f8ea52a318ÁmemchrÁRÎ÷׎™te~QÓ¿ØC\Ò-0bff3c8e8f4e489eÁ  –©HtGNÏ·ˆ!á-d69228d077d46f36Á futures_utilÁGæÖ`8ÕÀ³ñõYXh©-8b227c2895cd14a9Á pin_utilsÁ0š/'ÑÖå-ºòÊx-5acf1026789e9a52Á
futures_macroÁ&ùœþ™ÊQmÒqÒŠ€j-9d00c69ae3282ecfÁ futures_taskÁІŸWôaÖ„g2KA„-2109b5565a816e7aÁ futures_sinkÁí©ÈÍ@_Eï°Ø¡ò -18b0577532018ae5Ápin_project_liteÁæÑ#­U}ÍV-40a9b17583c53e9bÁfutures_channelÁuuKû÷brÈüåàW-15bbaff2e3c92011ÁslabÁyc›âÂþ?˜4–‡òé¯-7865db4977a08dc6Á
futures_ioÁ¢Ð0¾/ŠÓ½ƒÐIÀ}7¬L-76c95d1853d1eca9Á¡lEÝ ÐxmÞiXbdQ-215c3907ef89a370Áfutures_executorÁä¯'wœý£Ú¯ ]-74c9e5dddafa7858Á.
ThreadPoolÁT´<<À; thread-poolÁlÊ;¼À;.ThreadPoolBuilderÁŒÀ<:Î -+-compatÁ4¬=<Ý<
Dç<”Ý<³ 
  
 !"#$%&'()*+executorÁ.........â 8888888888 8
8 8 8
88888888888888.8³¤®Ì TryFutureÁL½ ! FutureExtÁLú © TryFutureExtÁd…!ÎStreamÁ4Æ!E
TryStreamÁLÎ!b StreamExtÁL"ý
TryStreamExtÁd"üSinkÁ$Î"
SinkExtÁ<#“) AsyncBufReadÁdË# AsyncReadÁLÙ# AsyncSeekÁLä#
AsyncWriteÁTï#AsyncBufReadExtÁ|½$½1 AsyncReadExtÁdÎ$š1 AsyncSeekExtÁdÜ$¸1
AsyncWriteExtÁlê$«1readyÁ,¤%pin_mutÁ<Ú%selectÁ4±&ç5joinÁ$ð&ä5pendingÁ<ö&& Ä $ÿ& !Ä !
select_biasedÁl…'æ5"try_joinÁD”'å5#4é'i% ,ñ'ð)&sinkÁ$ø'Ã%'streamÁ4þ'
(taskÁ$†(¼))
stream_selectÁlÜ(:*channelÁ<°)+lockÁ$ø)Ô1,ioÁ¼*ò)µKü.+ Abstractions for asynchronous programming.Á/Ëü3NK This crate provides a number of core abstractions for writing asynchronousÁL code:ÁŒËüEB - [Futures](crate::future) are single eventual values produced byÁüÖMJ asynchronous computations. Some programming languages (e.g. JavaScript)Áü¤" call this concept "promise".ÁüÇ;8 - [Streams](crate::stream) represent a series of valuesÁôƒ produced asynchronously.Áü¢FC - [Sinks](crate::sink) provide support for asynchronous writing ofÁ data.ÁüõKH - [Executors](crate::executor) are responsible for running asynchronousÁ tasks.ÁÎËüÒNK The crate also contains abstractions for [asynchronous I/O](crate::io) andÁü¡/, [cross-task communication](crate::channel).ÁÑËüÕOL Underlying all of this is the *task system*, which is a form of lightweightÁü¥JG threading. Large asynchronous computations are built up using futures,ÁüðLI streams and sinks, and then spawned as independent tasks that are run toÁü½;8 completion, but *do not block* the thread running them.ÁùËüýQN The following example describes how the task system context is built and usedÁüÏ85 within macros and keywords such as async and await!.Áˆ Ë ```rustÁü˜ ! # use futures::channel::mpsc;Áüº _\ # use futures::executor; ///standard executors to provide a context for futures and streamsÁüš
(% # use futures::executor::ThreadPool;ÁìÃ
 # use futures::StreamExt;Á

fn main() {Á
 # {Áüƒ DA let pool = ThreadPool::new().expect("Failed to build pool");ÁüÈ 0- let (tx, rx) = mpsc::unbounded::<i32>();Áù Ëüý OL // Create a future by an async block, where async is responsible for anÁüÍ PM // implementation of Future. At this point no executor has been providedÁüž
52 // to this future, so it will not be running.ÁüÔ
 let fut_values = async {Áüõ
PM // Create another async block, again where the Future implementationÁüÆSP // is generated by async. Since this is inside of a parent async block,ÁüšXU // it will be provided with the executor of the parent block when the parentÁüó! // block is executed.Át• //Áü¤SP // This executor chaining is done by Future::poll whose second argumentÁüøTQ // is a std::task::Context. This represents our executor, and the FutureÁüÍSP // implemented by this async block can be polled using the parent asyncÁü¡  // block's executor.ÁüÂ,) let fut_tx_result = async move {Áüï'$ (0..100).for_each(|v| {Áü—B? tx.unbounded_send(v).expect("Failed to send");Á”Ú })Á };ÁüËü€IF // Use the provided thread pool to spawn the generated futureÁüÊ+( // responsible for transmissionÁüö)& pool.spawn_ok(fut_tx_result);Á Ëü¤ let fut_values = rxÁüÄ .map(|v| v * 2)ÁÜä .collect();ÁËü„LI // Use the executor provided to this async block to wait for theÁüÑ" // future to complete.Áäô fut_values.awaitÁT };ÁœËü PM // Actually execute the above future, which will invoke Future::poll andÁüñTQ // subsequently chain appropriate Future::poll and methods needing executorsÁüÆTQ // to drive all futures. Eventually fut_values will be driven to completion.Áü›>; let values: Vec<i32> = executor::block_on(fut_values);ÁÚËüÞ(% println!("Values={:?}", values);Á\‡ # }Áü“ # std::thread::sleep(std::time::Duration::from_millis(500)); // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371Á,­ ```Á»Ëü¿QN The majority of examples and code snippets in this crate assume that they areÁü‘+( inside an async block as written above.Á¡Ì Ï û8à Ô ú8¬ $ é8Î ó ø8þ  ²8warningsÁD$ Š8rust_2018_idiomsÁ„Œ$ œ8single_use_lifetimesÁ¤ž$ ³8è  ò8á$ Ì8unused_assignmentsÁ”Î$ à8unused_variablesÁ„âüÉ´.8³¤+®Ì»F!Ô_©î|ÎE
¡¬b ºÅý
Ôâüñ÷
 “)+ ¹D Ò] ëw ½1¥³ š1ÂÐ ¸1ßî «1ý

¬4
ç5ÄJ
ä5Úc
& Ä t
!Ä t
! 
æ5"°º
å5#Ì
i% Ü
ð)&ëñ
Ã%' 
( ¼))¬; :*ÊS +ág Ô1,öz ò)-üž )++FFüã /__||ü¯!)¬¬üô!/ÅÅââ”À"÷Üî" ü¾#<+ + D D ] ] w w ü®$J  ³ ³ Ð Ð î î œ–%
¬Ì%
¤£&4
üá&<J
J
c
c
t
t
 
 
º
º
üÚ'1Ì
Ì
Ü
Ü
ñ
ñ
    ÜÎ(; |)S ”ê)g „®*z „’+»Ã* Æ* Û*8<Ç* Ï*7ðTÑ*äÁ*ü©+)& Built-in executors and related tools.Á×+Ëüß+DA All asynchronous computation occurs within an executor, which isÁü¨,FC capable of spawning futures as tasks. This module provides severalÁüó,?< built-in executors, as well as tools for building your own.Á·-Ë¿-ËüÇ-EB This module is only available when the `executor` feature of thisÁÌ‘. library is activated.Á¯.Ëü·./, # Using a thread pool (M:N task scheduling)Áë.Ëüó.MJ Most of the time tasks should be executed on a [thread pool](ThreadPool).ÁüÅ/NK A small set of worker threads can handle a very large set of spawned tasksÁü˜0MJ (which are much lighter weight than threads). Tasks spawned onto the poolÁüê0NK with the [`spawn_ok`](ThreadPool::spawn_ok) function will run ambiently onÁĽ1 the created threads.ÁÚ1Ëüâ1 # Spawning additional tasksÁ†2ËüŽ2KH Tasks can be spawned onto a spawner by calling its [`spawn_obj`] methodÁüÞ2MJ directly. In the case of `!Send` futures, [`spawn_local_obj`] can be usedÁd°3 instead.ÁÁ3ËüÉ3 # Single-threaded executionÁí3Ëüõ3KH In addition to thread pools, it's possible to run a task (and the tasksÁüÅ4NK it spawns) entirely within a single thread via the [`LocalPool`] executor.Áü˜5NK Aside from cutting down on synchronization costs, this executor also makesÁüë5GD it possible to spawn non-`Send` tasks, via [`spawn_local_obj`]. TheÁü·6OL [`LocalPool`] is best suited for running I/O-bound tasks that do relativelyÁü‹7'$ little work between I/O operations.Á·7Ëü¿7JG There is also a convenience function [`block_on`] for simply running aÁüŽ8/, future to completion on the current thread.ÁÂ8ËüÊ8_\ [`spawn_obj`]: https://docs.rs/futures/0.3/futures/task/trait.Spawn.html#tymethod.spawn_objÁü®9pm [`spawn_local_obj`]: https://docs.rs/futures/0.3/futures/task/trait.LocalSpawn.html#tymethod.spawn_local_objÁDš+block_onÁDÈ: C0block_on_streamÁ|Ò: F1enterÁ,ã: o2BlockingStreamÁtê:Œ3EnterÁ,ú:f4
EnterErrorÁT;h5 LocalPoolÁL;z6 LocalSpawnerÁd ;7ü¬:‡Ê̯±ž rt\^GI/1|àAüöA52 A "prelude" for crates using the `futures` crate.Á°BËü¸BLI This prelude is similar to the standard library's prelude in that you'llÁü‰CDA almost always want to import its entire contents, but unlike theÁüÒC=: standard library's prelude you'll have to do so manually:Á”DË<œD7ô¨D # #[allow(unused_imports)]ÁäËD use futures::prelude::*;Á<ìD7øDËü€EJG The prelude may grow over time as additional items see ubiquitous use.Á<èA$èEi:%¤4îE®Ì;»LöE!<ë$œFÃ%>'ñ$¢F
?$ÅF
A(4ËFEB¡LÓFbCdºIL¹LÈIMÒLÓINëTÞIO ½G©E ÐGÎF ŽH“)G îHýI IüJ ðJ½1Q ƒKš1R K¸1S ªK«1TüØE(_4ßESVGJÌŽFA$•F47üµF(/4¼F"%ü G2L°GØdÀGΤöGÄüÑH2LáH¿dñHµü®I;;>14'* üÈJj|ÝJÍdóJÃd†K¹l™K¯' crate::sinkÁ ExecutorsÁcrate::executorÁ.asynchronous I/OÁ crate::ioÁcross-task communicationÁFuturesÁcrate::channelÁ
crate::futureÁStreamsÁ
crate::streamÁ