Files
boc/rust-service/target/debug/deps/libmio-325017fc6dce34b0.rmeta
T

1204 lines
388 KiB
Plaintext
Raw Normal View History

rust
Ô#rustc 1.96.0 (ac68faa20 2026-05-25)ÁÀ뉊]!ÜÛê(¹Þ—šên-5be7b69c3ff7b5b8ÁíàÄTËŸ ÜJîÄ)'ß\¥!-3d1337db07d0b3aeÁ¤²XctÔ'ÐÓ©z¨ɽÓ-a4945860e1c53b00Á¤°ð ¾ä-±($²ï=©Ã-7e98a21bfd32b0edÁòÖÀH•‘PIÓHã#£-055f30b747f859b6Árustc_std_workspace_coreÁ­Cçß^ò½èÝ$­Çÿ+Cé-c4878ee60b2242c9ÁŸÃï+Ñ]ŠqB<ÏïW#-8dd1dd90e70d0b6aÁ miniz_oxideÁ€š»J(P>àö÷g\K-1eb618da2918ab7fÁadler2ÁÆ;+Þ®5¥Ìýݰ¦ÛLˆ-f7919172d268e069Á hashbrownÁPäV9ÒÆèÜ"ÊÖVŽ\-0fc2184a5da6723aÁrustc_std_workspace_allocÁs&ØòØy¯s•bæ!‰ýŠ-97e4bf30be240674Á
std_detectÁhŠBîÙºÌI®ËÅš-9dbbf8346ba7ac8bÁrustc_demangleÁûë9´Ç×@Œ’ùXFº-f33013f239bf9f14Ácfg_ifÁÜLhž§Œaã¯>­-0a71c8f33a838301Á addr2lineÁ׎Þ!]8V$É@@-e618e6be60e87ba2ÁgimliÁ¸
°µ~Î1‹Ñt ðÁ€w-1f7768a68858f670ÁobjectÁ
áPÃ?­À¶¼QHJ¥-914cd6a4dbe590d1ÁmemchrÁ›º«8Ór­2Ù $¨ûib-cf21ca6f2bb15dcdÁë
‹ás«LÖ€îâƒ×ɯŒ-ee6f3747e38367f0Á?A©ú¡E2¯ëäu-8e0657b9e365f274ÁhermitÁ4™úwasiÁ$‡úŠ”òââŽAsRawFdÁ<Áú FromRawFdÁLÊúî RawFdÁ,Õúî:WakerÁ,äúsolarisÁ¬«¨ô,‚úî¤Òþ¸úþÖúî¸úÖúî£
SocketAddrExtÁl9úandroidÁ¬£testsÁ,þ%$ó%set_nonblockingÁ| ŒúaixÁŒÆ‹úillumosÁ¬Ù‹úŸ ¬ð‹úvitaÁ”‡ŒüÅ‹U[shellÁ,»os-pollÁ˜¿ ¨¿ƒ ð¸
úî¤ì
ð AsRawSocketÁ\Ï
â
ªAsFdÁ$Ø ú ª¸ úîª
BorrowedFdÁTç úî6Ö úîK IntoRawFdÁLþ úîiOwnedFdÁ<‰ úô,’ úîšœª  â<  ªAsSocketÁD× âªBorrowedSocketÁtá â<
FromRawSocketÁlñ â[
IntoRawSocketÁl€ âz OwnedSocketÁ\ ♪ RawSocketÁLœ â²´ç¨  úî¤ö ç¸ úîçØ  úî,Ö úîAŒ
 úîVª
 úîkô úî‚ç \™ â çï
 âç â&© â8È âJç â\ ân¨ 
ú
Ǹ
úîÇØ 
úî,Ö
úîAŒ
L€
úîVª
<
úîkô,”
úî‚Ç 
â
Çï

âÇ
â&©
â8Èl
âJç\
â\
ânpÀmacrosÁ cfg_os_pollÁcfg_not_os_pollÁ
cfg_os_extÁcfg_netÁ
cfg_io_sourceÁcfg_any_os_extÁtraceÁÕerrorÁlogÁinterestÁREADABLEÁWRITABLEÁAIOÁLIOÁPRIORITYÁ¬ÏremoveÁ is_readableÁ is_writableÁis_aioÁis_lioÁ is_priorityÁ#°#±&²(׊ ********** *
* * *
******·>registryÁ*RegistryÁ@selectorÁ@ has_wakerÁ*CÝCŠ *F as_raw_fdÁ*H×*JregisterÁK¤J
reregisterÁM¤J
deregisterÁO¤J try_cloneÁQ Jregister_wakerÁJû*U×*Was_fdÁ*Y°sysÁtokenÁ\]÷wakerÁ______eæ f ewakeÁeventÁiÆjjjjjoõooois_errorÁois_read_closedÁois_write_closedÁoÉo¯o¼ofrom_sys_event_refÁjz×{ EventDetailsÁ|
|'aÁ|ˆ{×ieventsÁEventsÁinnerÁˆ
with_capacityÁˆcapacityÁˆis_emptyÁˆùˆclearÁˆëŒIntoIterÁêŒó  size_hintÁüš×isourceÁœœœœœœÜ¢Ï¢å¢ýœ¦¥¦Ï¦å¦ýiiiiiú·pipeÁ¸¸¸¸·featuresÁguideÁInterestÁÀ
ÀˆÅÇÖ Êƒ
Ìï
 ÎCæ Ð [ debug_detailÁ[úÓsyscallÁ[ÓûÖÖÖÖÖÖÖÖÖÖ Ö
Ö Ö Ö
ÖÖÖÖÖÖÖÖNEXT_IDÁÖíæ íï íselectÁñ ñ íÏô ÖöÔÖø°Öinterests_to_epollÁÖEventÁÖÅÖÆýýýýõýýýýý¦ýÉý¯ý¼ý
debug_detailsÁŠ check_eventsÁÖÓÓŒŽŽŽŽŽŽŽŽŽŽ Ž
Ž Ž Žœæ œnew_unregisteredÁœ»Ÿ œ
ack_and_resetÁœfdÁœwokenÁœresetÁ¤ ަ°ÓsourcefdÁ¨¨¨¨¨¨¨¨°Œ°Ï°å°ýÓÓÉnew_rawÁ¹ ¹ ÖÖSelectorÁ½idÁ½epÁÖÀ×íå íýÄ ÖÆ£'Š
EventsDetailsÁÈ
ȈŠË×Östateless_io_sourceÁÍÍÍÍÍÍÍ
IoSourceStateÁÔ
ÍÖæ Ödo_ioÁØ¥ØØ£ÖÏÖåÖýÖŽŽ àÐ%ŽâרSourceFdÁä
äŒäˆ¨èŒè×ÓnetÁëëëëëëëëë
new_ip_socketÁë
new_socketÁëSocketAddrCReprÁöv4Áöv6Áëùas_ptrÁë socket_addrÁû ëto_socket_addrÁÓtcpÁþþþþþþþþþþ þ
þ þ þ
þ new_for_addrÁþbindÁþconnectÁþlistenÁþ
set_reuseaddrÁþacceptÁ  ÓudpÁ 
¾,only_v6ÁÓudsÁ£££££££££datagramÁ¬¬¬¬¬¬¬¬¬¬ bind_addrÁ¬unboundÁ¬pairÁ£listenerÁ¹¹¹¹¹¹¹¹¹¹ ¹
¹ ¹ ¹
¹¹¹¹Ý.¹ü,Ì £streamÁÎÎÎÎÎÎÎÎ connect_addrÁÎý.£UNNAMED_ADDRESSÁ£ path_offsetÁ£ unix_addrÁ£ý.Û¥Û  
  
æ öâ
ötry_ioÁøø¥ø üÏüåüýwriteÁ write_vectoredÁƒ flushÁ í2ˆ ÿ2Š š3Œ Ž÷ from_raw_fdÁ° into_raw_fdÁ÷ ˜Ô
š÷ œâ
œ¨2žž¥ž  ¢Ï¢å¢ý
¦readÁ§ ¦
read_vectoredÁ© «•5¬ «¦5® °÷²÷´4°¸ê3º÷¼Ô¾÷â
SenderÁÁÓÃ×ReceiverÁÅÓÇ×\TokenÁÉ
Ɉ\\\΃\Ð×\\Ó\ÕÖ\×ï
\ Ù\
Û§Üù_Ž ÞÓ_à×j™#âÓjäƒIterÁæŒæÓæposÁêŒê×íŒíƒ io_sourceÁðððððððððð ð
ð ð ð
ðððIoSourceÁ¥ºÓ selector_idÁð¥æ ú(£
into_innerÁð¥å´ð¥ð¥Ïåýð¥×ðœ UNASSOCIATEDÁœæ œ associateÁœcheck_associationÁœremove_associationÁð¢ƒð
SelectorIdÁ¤£'ð¦×“*¨Ù+©‰/ªªªªªªªªªª ª
ª ª ª
ªªªªªªªªªªªªªª TcpListenerÁÆÓªÈ¾,Èfrom_stdÁÈü,Ë Ì È
local_addrÁÈset_ttlÁÈttlÁÈ
take_errorÁªÒÏÒåÒýªÖתØ4ªÚ°ªÜê3ªÞ÷ªàÔªâ÷ª ä÷©©ƒ0çççççççççç ç
ç ç ç
ççççççççççççççç TcpStreamÁÓçÊ,Ä> peer_addrÁæ>shutdownÁ set_nodelayÁnodelayÁø>‡??peekÁ ¨2¥ ç•5˜ ¦5š 眕5 œ¦5Ÿ ç¡í2¢ ¡ÿ2¤ ¡š3¦ ç¨í2© ¨ÿ2« ¨š3­ ç¯Ï¯å¯ýç³×çµ4ç·°ç ¹ê3ç
»÷ç ½Ôç ¿÷ç
Á÷©¨¨¨¨”-ÇÇÇÇÇÇÇÇÇÇ Ç
Ç Ç Ç
ÇÇÇÇÇÇÇÇÇÇ UdpSocketÁßÓÇá¾,áÄ>áæ>áðAásend_toÁæ á recv_fromÁè á peek_fromÁê ásendÁì árecvÁî áÓBð áÊ,á
set_broadcastÁá broadcastÁáset_multicast_loop_v4Áámulticast_loop_v4Ááset_multicast_ttl_v4Áámulticast_ttl_v4Ááset_multicast_loop_v6Áámulticast_loop_v6Ááø>á‡?ájoin_multicast_v4Áájoin_multicast_v6Ááleave_multicast_v4Ááleave_multicast_v6ÁáÞ-á’?á¨2ƒƒ¥ƒ ÇÏåýÇ×Ç4ǰÇê3Ç÷ÇÔÇ÷Ç ÷¨¨í-œ . 
  
 UnixDatagramÁµÓ·¾,¸¡·Ý.·Ä>·Ê,¼¡·î.·ý.¿ ·æ>·ðA·ýFà ·ºGÅ ·éFÇ¡Ç ·©GÊ ·’?·‰B·¨2ÎΥΠÒÏÒåÒýÖר4Ú°Üê3Þ÷à÷âÔ ä÷œœ‰/çççççççççç ç
ç ç ç
çççççççççç UnixListenerÁÿÓç¾,¡Ý.Ä>ü,æ>’?çÏåýç×ç4ç°çê3ç÷ç÷çÔç ÷œœƒ0žžžžžžžžžž ž
ž ž ž
žžžžžžžžžžžžžž
UnixStreamÁºÓž¼Ê,½¡¼´0¼Ä>¼ý.Á ¼æ>¼ðA¼’?¼‰B¼¨2ÇÇ¥Ç žË•5Ì Ë¦5Î žÐ•5Ñ Ð¦5Ó žÕí2Ö Õÿ2Ø Õš3Ú žÜí2Ý Üÿ2ß Üš3á žãÏãåãýžçמé4žë°ž íê3ž
ï÷ž ñ÷ž óÔž
õ÷œ¨¨¨¨'
)
)
)
D
E
E
G
I
I
I
K
K
M
M
O
O
Q
S
T
V
V
V
X
Z
f
h
p
q
r
s
t
u
v
w
x
y
{
{
{




Š

Œ

Ž

˜



£
£
¤
¤
¥
¥
¨
¨
©
©
ª
ª
Æ
Æ
È
Ë
Í
Í
Ï
Ï
ï
ñ
ñ
ô
÷
ù


ƒ




ˆ

Š
Š
Š



Ÿ
¡
¢
£
¤
§
²
²
³
³
´
´
Á
Á
Á
Â
Ä
Ç
Ì
Ì
Ì
Ø
Ø
Ø
Ü
Ü
Ý
Ý
Þ
Þ
ã
ã
ã
ê
ê
ê
ú
û
Ž




¢

Ë
Ì
Ö
Ù
Ú
÷
ø
ý
ý
þ
þ
ÿ
ÿ


ƒ
ƒ
ƒ


ˆ
ˆ
Š
Š
Š
Œ



ž
£
£
¤
¤
¥
¥
§
§
©
©
©
«
¬
¬
®
®
®
·
½
Ä
Ä
Ä
È
È
È
Ï
Ñ
Ñ
Ñ
Ô
Ô
Ö
Ø
Ø
Ú
Ú
Ü
Ü
á
á
á
å
ì
ì
ì
ï








˜
˜



Ÿ
Ÿ
 
 
¡
¡
£
§
§
§
Ë
Î
Ï
Ð
Ñ
Ó
Ó
Ô
Ô
Õ
Õ
×
×
×
Û
á

Š

Œ

Ž





˜
˜
š
š
š
œ


Ÿ
Ÿ
Ÿ
¢
¢
¤
¤
¤
¦
¨
©
©
«
«
«
­
°
°
±
±
²
²
´
´
´
¸
¾
ä
å
æ
æ
è
è
ê
ê
ì
ì
î
î
ð
ð
ò
ó
ô
õ
ö
÷
ø
ù
ú
û
ü
ý
ý
ý
þ
þ
ÿ
ÿ
ÿ




ƒ
ˆ
ˆ


Š
Š
Œ
Œ
Œ


º
¼
Á
Â
Ã
Ã
Å
Å
Ç
Ç
Ê
Ê
Ì
Í
Î
Ó
Ó
Ô
Ô
Õ
Õ
×
×
×
Û
ã



ˆ
Š
Š


Œ
Œ
Ž
Ž
Ž

š
¿
Ã
Ä
Å
Æ
Ç
Ì
Ì
Î
Î
Î
Ð
Ñ
Ñ
Ó
Ó
Ó
Ö
Ö
Ø
Ø
Ø
Ú
Ü
Ý
Ý
ß
ß
ß
á
ä
ä
å
å
æ
æ
è
è
è
ì
ô
¢Š ÀÀÁˆ ˆ RS@Æ‘ôNÐì³hµß³h³h³hÛ³hسhíß³h³hº³h–ú³h³h•˜³h³h¿c³h«+>>·?Ý*ôHÜC¾=­¿cài¿c@@ìAû*BŠ*Wž¹{ÜУø,›j«+›j¿c½½“'¾£'Ö¿­'Ö%†¥-,êj«+êj¿cÈÈÉë'ʈý bkåêm,úÀ¿cààŽ áÐ%Žœ÷Ö³^ú«+øk¿cääåÙ)çˆ fÃÂ_ܲ®Œ¢·l¿cÁÁÏ6ÂÓª"ŒmÞªþ¢ýlŸ!ýlŸ! 8ýléýlº1º1
ChildStdinÁ»1Ó1J,CÏ·øû­+ýl«+ýl¯+ýléö+ö+ª
÷+Ð%ä+Þí¼>XG¸,ýl,ýléýl¶n¿cÅÅò6ÆÓ)¯0â|íÃM¢…oà …oà  8…oé…oÎ1Î1 ChildStdoutÁÏ1Ó1®Òô?é…oÞ1Þ1 ChildStderrÁß1Ó1+Oý‹k€M¯+…o«+…o­+…oé¶n…o,…oé…o¶nŠ ÉÉÊ–7ˈ ` ç åµ'Û¦qئq¿c¦qÐì¦qµß¦q¦q¦qíߦq¦qº¦qše¦qé¦q¿cÞÞŽ ßÓ_U¼ƒÇlØââ™#ãÓjn=TÈmªQ%¿c€s¿c||}õˆj ¡Ë‚_V8¿cææÎ8èÓéê8tâQó͙ܰŒØ÷sÇL ŒÅÓ1Nÿ8Þ?ùM÷s¿cÎt¢žBoxÁ¡ˆˆ¢ˆl }.xÏ¥çEçEèEGlobalÁ ¿±‡§í#é!ÿ9ƒºðÓð§:ð™]”Õ·Ùuö!’v¢’v¿c’v¿c¤¤×<¥£'ðÍÔ Å
‘ÙÿØ€w¢ÆÆœ>ÇÓª'*+¨ ù¿c¿w¯+¿w«+¿w­+¿wé¶n¿w,¿wé¿w¶néŠ#Š##œ>Œ#ˆô" N À];óÉ¿wà ÂAÓç¤c|Pءÿà  8üxŸ!üxŸ!±y¢üx¿cüx¯+üx«+üx­+üxé¶nüx,üxéüx¶né‡#‡#ˆ#ÂA‰#ˆô" ¤‰?ßøüx¢ßß«FàÓÇbA—À¿cçz¯+çz«+çz­+çzé¶nçz,çzéçz¶néð#ð#ñ#«Fò#ˆà# ¬ãøàFð™çz¢µµÖLÓ…Ê:pûW›¿c¤|¯+¤|«+¤|­+¤|é''“'ÖL”'ˆñ& ÒÛ0É@ßh¤|é¶n¤|,¤|é¤|¶n¢ÿÿºPÓçŸ=%Q/iw¿cá}¯+á}«+á}­+á}éã'ã'ä'ºPå'ˆË' Nó:xÔ§eöá}é¶ná},á}éá}¶nà ºº¬S»Óž†ùcEãhÿúà  Ÿ!žŸ!Ó¢ž¿cž¯+ž«+ž­+žé­(­(®(¬S¯(ˆê% ×¶'™g$²žé¶nž,žéž¶nÃÀÌÉÄÀÒÉÅÀÓÉÇÀÕÉÉÀÍÉÊÀÎÉäâíæ¢¤ÌÀ×ÉÎÀÙÉ#À&À(ÀH>U½ËÈâàèäÃÁÇÅÐÉàÞzâæš¦¤ÖƳßÖµÿçºF>Y½¦àÁÅÚÆ·ßÚµÿëºW½˜Á¼ÅàÆ½ßâµÿóº°äüÁ¢Å¦ÒƯßÒµÿãºÁ
¡¨
ÕºÜ
ŽÁö+šÁ°Å²Åºö+¾Å]Þö+âÆäŠ#»ö+¿Á‡#“ö+—ßð#Þ’'àö+äµã'—ö+›ÿï­(ñö+õºÁ¸ÅÜÆ¹ßܵÿíºÁ´ÅØÆµßصÿ麦ū
œ
˺Ð
ÛÉ
æŠ ˜ÐìµßÛØíß#º–ú•˜¿c«+ š,
P¢ DŸ!Mé$­+³¯+8à 8še$ÇLùMé!ö!0b0001Á0b0010Á0b0100Á0b1000Á0b10000Áü™-ü¢"

Ä¢
´
 5ü7 À ÆüñW³hD…ô ô õ ¨÷ ˆÐ  mjçítoé¹]šü¸ -üÁ "

ÄÁ ™Š 0ü¯ 7 À å ü W³hýŠƒ,iüà-üé"

Ä陊D‚ 0ü×7 À ü¸W³hýŠƒ,iüïAä‘d‘4‘ýŠ
'˜
·
7,˜ œl < ýŠ
'¨ëŽ2 ¬­
üø6

Äø™Šæ& ­üæK À °·ü¨ ³h³h³h,¿ýŠ^]]ýŠ^ýŠG¹
KvÌ»ýŠ
'ÃëŽ2 ÇX  Óô» Ø
ßüŠU³hÊÉýŠÉ!AŒÌåýŠ
'íëŽ2 ñX  ýôå 
ü´U³hÊÉýŠÉ!AŒ¤†!d‡!4‡!ýŠ
'Ž!ëŽ2,Ž! !X ! ™!̆! ž!
¥! üÚ K³hÊÉýŠÉ!AŒ¤¢"d£"4£"ýŠ
'ª"ëŽ2,ª" ®"X ²" µ"Ì¢" º"
Á"!üö!K$“"³h$Š"ÊÉýŠÉ!AŒÌÈ#dÉ#4É#ýŠ
'Ð#ëŽ2,Ð# Ô#X DØ# à#ôÈ# å#
ì#"ü—#U$¹#³h$°#ÊÉýŠÉ!AŒ¿r¿r¿r÷Ø ¿r4AN 
 ùüØ#؃ȜȜ¡ÊœøÈœ³H% ÚèØÈœÊœc¿r¿r¿r¿rüÉ4$

„É4

ŒÄ”Ú4
¿r
9ü¬4L
¤ ÷4
þ4
žü…4y
€wT—4
¤]¤]V¦]Á‚]üß3ø¤”&¿r²K¿rœ£ ÀÁ%³h0ýŠ8?ÐAë ÈÉ&¿k18?¼á äå'ääåÙ)çˆ fÃÂ_ܲ®` jq„±' ÉÊ%¦q0¿r7>¼À@ |}%||}õˆj ¡Ë‚_V\ ÐÐ epoll_eventÁѨÒÚ4è6ÞXÒ¢¢©*[\_i·¾¿ð¨ÀÅ °­ˆ D”
À±·$­
>³ì
@´7,Í
ɵ–7ÊµŽ ,ŸÞüÊOü³OL Mio is a fast, low-level I/O library for Rust focusing on non-blocking APIsÁüƒPM and event notification for building high performance I/O apps with as littleÁüÔ2/ overhead as possible over the OS abstractions.Áú\ # UsageÁúü›OL Using Mio starts by creating a [`Poll`], which reads events from the OS andÁüëMJ puts them into [`Events`]. You can handle I/O events from the OS with it.Á¹úü½" For more detail, see [`Poll`].Áàúüä%" [`Poll`]: ../mio/struct.Poll.htmlÁüŠ/, [`Events`]: ../mio/event/struct.Events.htmlÁºú ## ExamplesÁÎúüÒPM Examples can be found in the `examples` directory of the source code, or [onÁ GitHub].Á°úü´EB [on GitHub]: https://github.com/tokio-rs/mio/tree/master/examplesÁúú ## GuideÁúüA> A getting started guide is available in the [`guide`] module.ÁÑúÌÕ ## Available featuresÁïúüóDA The available features are described in the [`features`] module.Á*[\_i·¾¿ð¨À7Å8°­ˆ 7À±·6>³ì5@´–74ɵ–7EÊµŽ 4ÞÀÃÆT‚ 4† Ķ  Ï   Õ ä , Ö  × â , Ø 8÷ & Ý 8÷ 
ã *æ  é þ , ó  ô ÷ +   ƒ œ 8â    8»<ˆ  7Ø L + ª  « Û 8ä  ´ Ú 8docsrsÁ $ » 8Ó½  À Ù 8âÁ  Ä Ø 8» Í 7Ø  , é 8÷
ø äª  Ç ¾  Í Ü , Î  Ï Ú , Ð 8÷ & Õ 8÷ 
Û *Þ  á ¼ , ë  ì µ + ú  û  8âü  ÿ ˜ 8
  ƒ  8»<„ Œ 7Ø  , § 8÷
 ¼æ  þ ­    ,     ,  8÷$ˆ & Œ 8÷$ 
 *  ˜ « , ¢  £ ¤ + ±  ² Ê 8â³   É 8» ¿ 7os-extÁ + Ø  Ù ˆ 8ä  â  8í± $ é 8Óë  î  8âï  ò  8» û 7¶¶ ,  8÷$—
¥ ¤Ò  ç   í ü , î  ï ú , ð 8÷ & õ 8÷ 
û *þ   Ž ,   Œ  + š   ° 8✠ Ÿ ¯ 8»<  ¨ 7“* + ¾  ¿ ë 8ä  È ê 8í± $ Ï 8ÓÑ  Ô é 8âÕ  Ø è 8» á 7“* , ù 8÷
ˆ Ôþ l  Š  Ÿ ® ,    ¡ ¬ , ¢ 8÷& § 8÷
­ *°  ³ ˆ , ½  ¾ + Ì  Í
8âÎ  Ñ
8ºÒ  Õ
8» Þ 7“*$ å 8£ç  ê ƒ
8ú$ ï 8» ù 7¶¶+

å
8äD
 ž
ä
8í±
$ ¥
8Ó§
 ª
ã
8â«
 ®
â
8º¯
 ²
á
8»
»
7“*
$ Â
8£Ä
 Ç
à
8ú
$ Ì
8»
Ö
7¶¶
, ó
8÷
ÜÝ  ù Ô
 ÿ Ž ,  Œ , 8÷ & 8÷$ˆ 
*  Ò
,  ž Ë
+ ¬  ­ Û 8â®  ± Ú 8º²  µ Ù 8» ¾ 7¶¶ $ È 8» Ò 7“* + é  ê ¯
8ä  ó ®
8í± $ ú 8Óü  ÿ ­
8â
 ƒ
¬
8º

«
8»<ˆ
7¶¶D
$ š
8»
¤
7“*
, ½
8÷
Ì
”×
 ê
£  ð
ú
, ñ
 ò
ø
, ó
8¿ ô
& õ
8¯ö

ù
*ü
 ÿ
¡ 8ô  Œ    8Õ $  ,     ,  8¿ ˜ 
š Œ¦  ¸ ð  ¾ È , ¿  À Æ , Á 8¿  & à 8¯Ä 
Ç *Ê  Í î 8ô×  Ú  Û è 8Õ $ à , â  ã æ , ä 8¿ å 
ç ”ó ,€   ¿  Œ  ,   Ž  ,  8¿  &  8¯ 
 *˜   ½ 8ô¥  ¨  © · 8è $ ¯ , ±  ² µ , ³ 8¿ ´ 
 „Â Ï  Ó À  Ù ò , Ú 8levelÁ & à 8¼ $ ç , é  ê ð , ë 8¿ ì & í 8¯î 
ñ *ô  ÷ ¾ +     8⃠   8»<‡  7ô,  ¡ ¸ 8ô£ '¦ , ¨ 8ÀÈ  ®  ¯  , °  ± ´ , ² 8¿ ³ 
µ + ð  ñ  8âò  õ Š 8
ö  ù  8»  7ô,„   ¸ 8 8      8¢ 8 ¦ ¨  ª ³ , ¬  ­ ° , ® 8¿ ¯ 
± % ´ d D“ ÀÁ NonZeroU8ÁL¤”×#¤,­
( œ7)+”Ý”úD€Òê”üD‚l›³h !"äñü¯=: Returns a `Interest` set representing readable interests.ÁDû³hä üÎ=: Returns a `Interest` set representing writable interests.ÁDš ³hä¸ü¯HE Returns a `Interest` set representing priority completion interests.ÁúlinuxÁœ†ú¸
¬›ü…,üü7³hü¨3ü•  Add together two `Interest`.ÁºúüÂDA This does the same thing as the `BitOr` implementation, but is aÁ´‹ constant function.Á¦ú ```Á´º use mio::Interest;ÁÕúüÝKH const INTERESTS: Interest = Interest::READABLE.add(Interest::WRITABLE);Áü­2/ # fn silent_dead_code_warning(_: Interest) { }Áüä)& # silent_dead_code_warning(INTERESTS)Á<ßÒ.üËXHthis returns the result of the operation, without modifying the originalÁµ³h³h³h
ú"¹
ø"ü±8ü½+( Removes `other` `Interest` from `self`.ÁíúüõDA Returns `None` if the set would be empty after removing `other`.Á¾úßÒ´ÒïÒíúüõNK const RW_INTERESTS: Interest = Interest::READABLE.add(Interest::WRITABLE);ÁÈúüÐ=: // As long a one interest remain this will return `Some`.Áü’FC let w_interest = RW_INTERESTS.remove(Interest::READABLE).unwrap();ÁüÝ'$ assert!(!w_interest.is_readable());Áü‰&# assert!(w_interest.is_writable());Á´úü¼>; // Removing all interests from the set will return `None`.Áüÿ<9 assert_eq!(w_interest.remove(Interest::WRITABLE), None);ÁÀúüÈ>; // Its also possible to remove multiple interests at once.Áü‹85 assert_eq!(RW_INTERESTS.remove(RW_INTERESTS), None);ÁßÒ.üÔXêÔ³h³hÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ³h
$¿¹
üŠ&ü»:7 Returns true if the value includes readable readiness.Á.\ú\—³h
O&ü´&üå:7 Returns true if the value includes writable readiness.Á.\¤³h
Ô%üÚ !ü 63 Returns true if `Interest` contains AIO readiness.Á.\Ê ³h
U%üö!!ü«!63 Returns true if `Interest` contains LIO readiness.Á.\æ!4ƒ"³h
!Ö$ü—#&üÇ";8 Returns true if `Interest` contains priority readiness.Á.\‡#\¤#³h
"\$äð#³h$%˜ú™ú%\“$4˜$##³hüº$#,½$³h³h³h##
%$Ã$¹
,É$ü%"³h'—˜'ü¸%'d»%ü ü³h³h& È%&
'$Í%¹
,Ó%ä&³h)Àc)ü²&:µ&ýþÿ ý³h þ c cˆ¢cµ
 `£cbufÁ `àB¤GS
ÿÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ŸÈŸÈ ÈErrorÁ O˜éBL( ¹&(
)$º&×À&D >@¨ ,*,¸«+*-Ø T¸ÎN*.ôª+*/
AtomicBoolÁT·¬]*1®¼À*2K°†J*3DurationÁDÄ­Ö*4ר¤,*6ioÁݦ*7Æi*9ëö[*:Å*;°­ˆÀ*<±7,É*=µ7Ê*=µ\X[KN>A14Œ£!œ¹ôÒæèÕ×,çÊ̼¾®°†|Œ[ü–85 Polls for readiness events on all registered values.ÁÏúüÓLI `Poll` allows a program to monitor a large number of [`event::Source`]s,Áü OL waiting until one or more become "ready" for some class of operations; e.g.ÁüðNK reading and writing. An event source is considered ready if it is possibleÁü¿FC to immediately perform a corresponding operation; e.g. [`read`] orÁt†  [`write`].Áúü™ NK To use `Poll`, an `event::Source` must first be registered with the `Poll`Áüè HE instance using the [`register`] method on its associated `Register`,Áü±
KH supplying readiness interest. The readiness interest tells `Poll` whichÁüý
LI specific operations on the handle to monitor for readiness. A `Token` isÁüÊ MJ also passed to the [`register`] function. When `Poll` returns a readinessÁü˜ JG event, it will include this token. This associates the event with theÁüã *' event source that generated the event.ÁŽ
úü’
0- [`event::Source`]: ./event/trait.Source.htmlÁüÃ
52 [`read`]: ./net/struct.TcpStream.html#method.readÁüù
74 [`write`]: ./net/struct.TcpStream.html#method.writeÁü±63 [`register`]: struct.Registry.html#method.registerÁèú # ExamplesÁûúüÿ=: A basic example -- establishing a `TcpStream` connection.Á½ú```ÁäÔ # use std::error::Error;Áüñ/, # fn main() -> Result<(), Box<dyn Error>> {Áü¡-* use mio::{Events, Poll, Interest, Token};ÁäÏ use mio::net::TcpStream;Áìúüð%" use std::net::{self, SocketAddr};Áúüš*' // Bind a server socket to connect to.ÁüÅ2/ let addr: SocketAddr = "127.0.0.1:0".parse()?;Áüø/, let server = net::TcpListener::bind(addr)?;Á¨úü¬MJ // Construct a new `Poll` handle as well as the `Events` we'll store intoÁüú  let mut poll = Poll::new()?;Áü›1. let mut events = Events::with_capacity(1024);ÁÍúÌÑ // Connect the streamÁüë?< let mut stream = TcpStream::connect(server.local_addr()?)?;Á«úü¯&# // Register the stream with `Poll`ÁüÖ^[ poll.registry().register(&mut stream, Token(0), Interest::READABLE | Interest::WRITABLE)?;Áµúü¹KH // Wait for the socket to become ready. This has to happen in a loop toÁü… // handle spurious wakeups.Á loop {Áü°&# poll.poll(&mut events, None)?;Á×úôÛ for event in &events {ÁüúA> if event.token() == Token(0) && event.is_writable() {Áü¼OL // The socket connected (probably, it could still be a spuriousÁÔŒ // wakeup)Áô§ return Ok(());Á
 # }ÁßÒôúŒø # PortabilityÁŠúüŽLI Using `Poll` provides a portable interface across supported platforms asÁüÛ>; long as the caller takes the following into consideration:Ášú¼ž ### Spurious eventsÁúüºEB [`Poll::poll`] may return readiness events even if the associatedÁü€EB event source is not actually ready. Given the same code, this mayÁüÆNK happen more on some platforms than others. It is important to never assumeÁü•JG that, just because a readiness event was received, that the associatedÁüà# operation will succeed as well.ÁúüˆLI If operation fails with [`WouldBlock`], then the caller should not treatÁüÕNK this as an error, but instead should wait until another readiness event isÁ
received.Á²úÔ¶ ### Draining readinessÁÑúüÕKH Once a readiness event is received, the corresponding operation must beÁü¡ NK performed repeatedly until it returns [`WouldBlock`]. Unless this is done,Áüð NK there is no guarantee that another readiness event will be delivered, evenÁü¿!52 if further data is received for the event source.Áõ!úüù!2/ [`WouldBlock`]: std::io::ErrorKind::WouldBlockÁ¬"úä°" ### Readiness operationsÁÍ"úüÑ"JG The only readiness operations that are guaranteed to be present on allÁüœ#NK supported platforms are [`readable`] and [`writable`]. All other readinessÁüë#HE operations may have false negatives and as such should be consideredÁü´$JG **hints**. This means that if a socket is registered with [`readable`]Áüÿ$MJ interest and either an error or close is received, a readiness event willÁüÍ%GD be generated for the socket, but it **may** only include `readable`Áü•&GD readiness. Also note that, given the potential for spurious events,ÁüÝ&NK receiving a readiness event with `read_closed`, `write_closed`, or `error`Áü¬'JG doesn't actually mean that a `read` on the socket will return a resultÁü÷'! matching the readiness event.Á™(úü(PM In other words, portable programs that explicitly check for [`read_closed`],Áüî(EB [`write_closed`], or [`error`] readiness should be doing so as anÁü´)MJ **optimization** and always be able to handle an error or close situationÁü‚*.+ when performing the actual read operation.Á±*úüµ*>; [`readable`]: ./event/struct.Event.html#method.is_readableÁüô*>; [`writable`]: ./event/struct.Event.html#method.is_writableÁü³+85 [`error`]: ./event/struct.Event.html#method.is_errorÁüì+DA [`read_closed`]: ./event/struct.Event.html#method.is_read_closedÁü±,FC [`write_closed`]: ./event/struct.Event.html#method.is_write_closedÁø,úÜü, ### Registering handlesÁ˜-úüœ-HE Unless otherwise noted, it should be assumed that types implementingÁüå-MJ [`event::Source`] will never become ready unless they are registered withÁ\³. `Poll`.Á¿.ú„Ã.
For example:ÁÔ.ú,”/\Ž/öäë/¬öœˆ0 # use std::net;Áüœ0/ÒöüÌ0%" use mio::{Poll, Interest, Token};Áäò0Á÷ì1 use std::net::SocketAddr;Áä­1 use std::time::Duration;Á¤Ê1 use std::thread;Áß1úüã152 let address: SocketAddr = "127.0.0.1:0".parse()?;Áü™241 let listener = net::TcpListener::bind(address)?;ÁüÎ2?< let mut sock = TcpStream::connect(listener.local_addr()?)?;ÁŽ3úü’3*' thread::sleep(Duration::from_secs(1));Á½3úäÁ3 let poll = Poll::new()?;ÁÞ3úüâ3NK // The connect is not guaranteed to have started until it is registered atÁŒ±4 // this pointÁüÃ4\Y poll.registry().register(&mut sock, Token(0), Interest::READABLE | Interest::WRITABLE)?;Á„ 5
# Ok(())Á<±5Ý<¹5ßÒÁ5ú¼Å5 ### Dropping `Poll`ÁÝ5úüá5NK When the `Poll` instance is dropped it may cancel in-flight operations forÁü°6OL the registered [event sources], meaning that no further events for them mayÁü€7PM be received. It also means operations on the registered event sources may noÁüÑ7MJ longer work. It is up to the user to keep the `Poll` instance alive whileÁüŸ8,) registered event sources are being used.ÁÌ8úüÐ8.+ [event sources]: ./event/trait.Source.htmlÁÿ8úüƒ9&# ### Accessing raw fd/socket/handleÁª9úü®9HE Mio makes it possible for many types to be converted into a raw fileÁü÷9NK descriptor (fd, Unix), socket (Windows) or handle (Windows). This makes itÁüÆ:JG possible to support more operations on the type than Mio supports, forÁü‘;LI example it makes [mio-aio] possible. However accessing t
 `£cûå `àB¤GS
¢çH “–H
I$”–ך–lü–›jKMOQSTü¥¶ü;8 Register an [`event::Source`] with the `Poll` instance.ÁЗúüØ—JG Once registered, the `Poll` instance will monitor the event source forÁü§˜KH readiness state changes. When it notices a state change, it will returnÁü÷˜FC a readiness event for the handle the next time [`poll`] is called.Á™úüÊ™0- See [`Poll`] docs for a high level overview.Áÿ™ú|‡š # ArgumentsÁ›šúü£šJG `source: &mut S: event::Source`: This is the source of events that theÁüòš?< `Poll` instance should monitor for readiness state changes.Á¶›úü¾›JG `token: Token`: The caller picks a token to associate with the socket.ÁüœJG When [`poll`] returns an event for the handle, this token is included.ÁüÜœDA This allows the caller to map the event to its source. The tokenÁü¥EB associated with the `event::Source` can be changed at any time byÁÜï calling [`reregister`].Ážúü—žEB See documentation on [`Token`] for an example showing how to pickÁ¬áž [`Token`] values.ÁûžúüƒŸJG `interest: Interest`: Specifies which operations `Poll` should monitorÁüÒŸJG for readiness. `Poll` will only return readiness events for operationsÁü¡  specified by this argument.ÁÅ úüÍ KH If a socket is registered with readable interest and the socket becomesÁü¡63 writable, no event will be returned from [`poll`].ÁØ¡úüà¡LI The readiness interest for an `event::Source` can be changed at any timeÁô±¢ by calling [`reregister`].ÁÔ¢ú\Ü¢÷àì¢úüô¢GD Callers must ensure that if a source being registered with a `Poll`ÁüÀ£HE instance was previously registered with that `Poll` instance, then aÁü¤EB call to [`deregister`] has already occurred. Consecutive calls toÁüפ'$ `register` is unspecified behavior.Áƒ¥úü‹¥KH Unless otherwise specified, the caller should assume that once an eventÁüÛ¥KH source is registered with a `Poll` instance, it is bound to that `Poll`Áü«¦IF instance for the lifetime of the event source. This remains true evenÁüù¦DA if the event source is deregistered from the poll instance usingÁœÂ§ [`deregister`].ÁÚ§úüâ§0Ÿóü—¨*' [`poll`]: struct.Poll.html#method.pollÁüƨ:7 [`reregister`]: struct.Registry.html#method.reregisterÁü…©:7 [`deregister`]: struct.Registry.html#method.deregisterÁüÄ©  [`Token`]: struct.Token.htmlÁé©útñ©¤õ„ªú,Ȫ\ªöä§«¬öœÈ«öšüà«/Òöü”¬-‹÷䯬Á÷ìç¬Ü›ü‰­'$ use std::time::{Duration, Instant};Áµ­úü½­ ºúâ­úüê­5Ñœü¤®4üÝ®A> let mut socket = TcpStream::connect(listener.local_addr()?)?;Á£¯úü«¯&# // Register the socket with `poll`ÁìÖ¯‹ë¤ø¯ &mut socket,ÁŒ‘°Ðëü§°2ìëÞ°úüæ°1äúüœ± let start = Instant::now();ÁüÀ±-* let timeout = Duration::from_millis(500);Áò±úTú±Ãþü‰²&# let elapsed = start.elapsed();Á´²úü¼² if elapsed >= timeout {Áüà²# // Connection timed outÁÔˆ³ return Ok(());ÁL§³½µ³úü½³*' let remaining = timeout - elapsed;Áüì³1. poll.poll(&mut events, Some(remaining))?;Á¢´úôª´’ÿüÍ´*' if event.token() == Token(0) {Áüü´?< // Something (probably) happened on the socket.ÁôÀµlãµ§Lõµ½,ƒ¶Ï<Ý<™¶ßÒD¬¶ˆ  ‡ ›j ˆ ¤¦q³hñðJ¤LL ¸¶JÎìÄ• µ¶¢Ä•l™·
KÄ•
the poll.Á´Òúü¼ÒLþšüÓ5Õ›ÇÓúüÏÓ?< A handle can be passed back to `register` after it has beenÁü“ÔHE deregistered; however, it must be passed back to the **same** `Poll`ÁüàÔ41 instance, otherwise the behavior is unspecified.Á™Õút¡Õ¤õ´Õú,øÕ\òÕöä×Ö¬öœøÖöšü×/ÒöüÄ×-‹÷äö×Á÷ì—ØÜ›乨‚œÚØúüâØ ºú‡ÙúüÙ5ÑœüÉÙ4ü‚ÚAóŒÈÚúüÐÚ&ÌìûÚ‹ë¤ÛŠŽŒ¶ÛÐëìÌÛ² îÛúüöÛ-* poll.registry().deregister(&mut socket)?;Á¨Üúü°Ü1äúæÜúüîÜGD // Set a timeout because this poll should never receive any events.ÁüºÝ:7 poll.poll(&mut events, Some(Duration::from_secs(1)))?;ÁüùÝ assert!(events.is_empty());ÁÞë <²ÞÝ<¾ÞßÒTÑÞŒ  ‹ ›j Œ Ä•ñðJ¤PP ßÞJó• ÜÞ…–lß
OÄ•$àÞ¦4æÞ')üáá/ü à1. Creates a new independently owned `Registry`.ÁÖàúüÞàIF Event sources registered with this `Registry` will be registered withÁü¬á0- the original `Registry` and `Poll` instance.ÁLèá   ›jÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
›jÂñJ òáJ
Q$óáT¹âQ<closure_kind>ÁR<closure_signature>ÁR<upvars>ÁRRQRêj›j ›jüÅå#„øäúŠ”’åú®Î¬¦åü‘å+üå0ü÷äGüîäRtÓåŽ  Ž ›jJ âåJ
S$ãåü°è/úŠ”Ëç¤Ê结*|àçüÆç*ü½ç5D¾è   j  êjJ ÇèJ
T$Èèä‚é›jVÀcVü¥é:¨é     j   c cˆ¢cµ
 `£cûå `àB¤GS
¢çU ¬éU
V$­é׳鴰íú$¨êÀñü¶êüµê! ú Œíêú„ò¤ˆëú—òœ¦ëú½òœÃëú©ò¬àëúî¤ÿëúÜòìúíòŒ¹ìú± ”ÔìúŠó¤ðìú®Î¬ŽíüãêÆüßêËü¢êü™ê›jXŽ,XüÍí!,Ðí “ ›jÎNÎNØ ÐNÐ%ä+ÑN_phantomÁä+§]òÞ^W ÖíW
X$×í̯ñú$§îÀñüµîü´î! ú Œìîú„ò¤‡ïú—òœ¥ïú½òœÂïú©ò¬ßïúî¤þïúÜò”œðúíòŒ¸ðú± ”ÓðúŠó¤ïðú®Î¬ñüâîÆüÞîËü¡îü˜î›jZ¬+ZäÏñLÒñ ” ›jY ÜñY
Z$Ýñ « ÓÉÕÙ)DäÕµÙ)åÕµÙ+£!þÕ”-¿!Õí-ž"£Õ™#,™ ûÕÅüÕÆýÕŽ ,Ì6àÕŒ“'DͽÕÓ(lª7ÔÕßÓ(ÕÕß ÉÊÔÏ'¿r^ë^äð'$ó'¦q¿r]]
^¹ø' ú®Î¬É úŠ”à üÈ +üÄ 0ü» ; Þë [_aìD@_b´7,É_cµ7Ê_cµ“é-¦_d,fhY[HJ<(!T­ÌrfhüÜB̾ Create a new `Waker`.Áã • ›j¦qÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ÌrÂñe ñe
fÝõ<fï¶g‡·g¤·ggfgøkÌrü§$üÁ63 Wake up the [`Poll`] associated with this `Waker`.Áüúô„ [`Poll`]: struct.Poll.htmlÁ$® – Ìrñðe ³e
h$´ ü(% Readiness event types and utilities.Á, jœ™#,†â«Å­Î8$¬æ®Ü¢¯LM,Që [jl7,Éjmµ7Êjmµ×#¤,jn,PRCED€spqrstuvwxyäíôÊ Returns the event's token.Á,ô — €s¦qo úo
püÿ!ü¾:7 Returns true if the event contains readable readiness.Áýú\…÷àúüB? Out-of-band (OOB) data also triggers readable events. But mostÁüäB? applications don't actually read OOB data, this could leave anÁü«=: application open to a Denial-of-Service (Dos) attack, seeÁüíŒ <https://github.com/sandstorm-io/sandstorm-website/blob/58f93346028c0576e8147627667328eaaf4be9fa/_posts/2015-04-08-osx-security-bug.md>.ÁüþLI However because Mio uses edge-triggers it will not result in an infiniteÁüÏ+( loop as described in the article above.Á\† ˜  ˜ €so o
q$“ üš
!üÛ :7 Returns true if the event contains writable readiness.Á\¡
 ™ €so ­
o
r
ôüö
74 Returns true if the event contains error readiness.Á² úüº KH Error events occur when the socket enters an error state. In this case,ÁüŠ IF the socket will also receive a readable or writable event. Reading orÁüØ 2/ writing to the socket will result in an error.Á
ú\—
÷à§
úü¯
KH Method is available on all platforms, but not all platforms trigger theÁ„ÿ

error event.Áúüœ<9 The table below shows what flags are checked on what OS.ÁÝúüå'$ | [OS selector] | Flag(s) checked |Áü‘'$ |---------------|-----------------|Áü½'$ | [epoll] | `EPOLLERR` |ÁüéIF | [kqueue] | `EV_ERROR` and `EV_EOF` with `fflags` set to `0`. |Á·úü¿;8 [OS selector]: ../struct.Poll.html#implementation-notesÁüÿ?ÎÈüÃHøÉD—š  š €so  o
süº$üæ=: Returns true if the event contains read closed readiness.Á¨ú÷àÀúüÈIF Read closed readiness can be expected after any of the following haveÁl
occurred:Áü¨?< * The local stream has shutdown the read half of its socketÁüìIF * The local stream has shutdown both the read half and the write halfÁœº of its socketÁüÒJG * The peer stream has shutdown the write half its socket; this sends aÁü¡=: `FIN` packet that has been received by the local streamÁãúüëHE Method is a best effort implementation. While some platforms may notÁü¸DA return readiness when read half is closed, it is guaranteed thatÁü# false-positives will not occur.Á©úü±<É×òúüú'›Øü¦'ÌØüÒ'$ | [epoll] | `EPOLLHUP`, or |Áüþ2/ | | `EPOLLIN` and `EPOLLRDHUP` |Áüµ'$ | [kqueue] | `EV_EOF` |Ááúüé;Úü©?ÎÈüíHøÉ › €so Ðo
tü˜&%üœ>; Returns true if the event contains write closed readiness.Áßú÷à÷úüÿEB On [epoll] this is essentially a check for `EPOLLHUP` flag as theÁüÉJG local stream shutting down its write half does not trigger this event.Á˜úü DA On [kqueue] the local stream shutting down the write half of itsÁüé# socket will trigger this event.Á úü™ Hñßüæ EB return readiness when write half is closed, it is guaranteed thatÁü°!#‘áØ!úüà!<Éס"úü©"'›ØüÕ"'ÌØü#'€âü­#+( | | only `EPOLLERR`, or |ÁüÝ#1. | | `EPOLLOUT` and `EPOLLERR` |Áü“$'íâ¿$úüÇ$;Úü‡%?ÎÈüË%HøÉ|Ÿ&œ  œ €so ¯&o
u$°&ü«,!üü&:7 Returns true if the event contains priority readiness.Á»'ú\Ã'÷àÓ'úüÛ'KÏÖœ«( priority event.ÁÃ(úüË(<É׌)úü”)'›ØüÀ)'ÌØüì)'$ | [epoll] | `EPOLLPRI` |Áü˜*'$ | [kqueue] | *Not supported* |ÁÄ*úüÌ*;ÚüŒ+?ÎÈüÐ+HøÉ\²,   €so ¾,o
v$¿,äÜ2ü‡-52 Returns true if the event contains AIO readiness.ÁÁ-ú\É-÷àÙ-úüá-LI Method is available on all platforms, but not all platforms support AIO.Á².úüº.<É×û.úüƒ/'›Øü¯/'ÌØüÛ/'$ | [epoll] | *Not supported* |Áü‡0+( | [kqueue]<sup>1</sup> | `EVFILT_AIO` |Á·0úü¿0?< 1: Only supported on DragonFly BSD, FreeBSD, iOS and macOS.Áƒ1úü‹1;ÚüË1?ÎÈü2HøÉ4ã2ž  ž €so ê2o
w$ë2ä’5ü®352 Returns true if the event contains LIO readiness.Áè3ú\ð3÷à€4úüˆ4KH Method is available on all platforms, but only FreeBSD supports LIO. OnÁüØ452 FreeBSD this method checks the `EVFILT_LIO` flag.Á4™5Ÿ  Ÿ €so  5o
x$¡5ü­6B”»6     °¤   €so Ù6o
y sys_eventÁLÎ6̰;üë8JG When the [alternate] flag is enabled this will print platform specificÁü¶9OL details, for example the fields of the `kevent` structure on platforms thatÁü†:KH use `kqueue(2)`. Note however that the output of this implementation isÁüÒ:.+ **not** consider a part of the stable API.Á;úü…;*' [alternate]: fmt::Formatter::alternateÁ€s{Àc{üÐ;8Ó;¡ ¢ £  ¡ €s ¢  c cˆ¢cµ
 `£cûå `àB¤GS
£ ¢çz ×;z
{$Ø;± Þ;NQdÇ@jŒ~~||}õˆj ¡Ë‚_VŒ¡Ë‚_V} Œ°¤úûNQyjÆüúû||
}ŒÔ@tØ@j||Æüüö@$8¤ ¤ ¾sÀcü­A8°A¥ ¦ §  ¥ ¾s ¦  c cˆ¢cµ
 `£cûå `àB¤GS
§ ¢ç ´A
8$µA± »ATX4\i†æ™#,⃫ë$[×3¤,œ?T,D.Œ„ ü9%" A collection of readiness events.Á_úücKH `Events` is passed as an argument to [`Poll::poll`] and will be used toÁü¯MJ receive any new readiness events received since the last poll. Usually, aÁüýJG single `Events` instance is created at the same time as a [`Poll`] andÁüÈ*' reused on each call to [`Poll::poll`].Áóúü÷30 See [`Poll`] for more documentation on polling.Á«úü¯30 [`Poll::poll`]: ../struct.Poll.html#method.pollÁüã! [`Poll`]: ../struct.Poll.htmlÁút‰¤õ˜úö䃬öü /ÒöäÐ use mio::{Events, Poll};Áä킜ŠúüŽ1äúüÀ ºúüç! # assert!(events.is_empty());Áúü-* // Register `event::Source`s with `poll`.Á»úü¿>; poll.poll(&mut events, Some(Duration::from_millis(100)))?;Áþúü‚  for event in events.iter() {Áü£96 println!("Got an event for {:?}", event.token());ÁÏ„ãë ÝßÒ4 Ît1Nÿ8Þ?”œ ªBªBö­Bûå÷<®B÷<9)
-ÜnL°¤ßu\‹Ît‰ŠŒŽü¢/üEB Return a new `Events` capable of holding up to `capacity` events.Áçú¤õúßÒ¤– use mio::Events;Á¯úü·-* let events = Events::with_capacity(1024);Áüé(% assert_eq!(1024, events.capacity());Á<ßÒ¿rÎtˆˆ
úü–ü³>; Returns the number of `Event` values that `self` can hold.ÁöúßÒ¤Šù‰£úü«-£ŠüÝ(ÚŠßÒD¨  ¨ Ît¿rˆ ¦ˆ
ŠôÐüá85 Returns `true` if `self` contains no `Event` values.Ážú¤õ¹úßÒ¤Íù‰æúüî-£Šü î±ßÒ©  © Îtˆ àˆ
ôùüš0- Returns an iterator over the `Event` values.ÁÏú¤õêú\’öäá¬öü‚/Òöä¶öƒäׂœøúü€1äúü¶ ºúÛúüã$! // Register handles with `poll`.ÁŒúü”>Ù…×úüß ­†ü„9׆Ï„Ìë ÝßÒ$€ª  ª ÎtææÎ8èÓéê8tâQó͙ܰª ˆ ˆ
Œ$†¼Å%üë:7 Clearing all `Event` values from container explicitly.Áªú÷àÂúüÊIF Events are cleared before every `poll`, so it is not required to callÁ”˜  this manually.Á¯ ú¤õÊ úöäÁ!¬öüâ!/Òöä–"öƒä·"‚œØ"úüà"1äúü–# ºú»#úüÃ#$®‘ì#úüô#>Ù…·$úÄ¿$ // Clear all events.ÁœÜ$ events.clear();Áüô$˜%ë <­%Ý<¹%ßÒ,Ì%«  « Îtˆ Ò%ˆ
$×%ü¯&0½&¬  ¬ Ît ¬ …‰ˆ Á&ˆ
Ž$Æ&üƒ'$ŒÈt‘ÈLÉLÊLˆ'L®'$³' Œ€slÉ'DÎ'÷süè'$Lë'ÈtÈtÉL
Œ$õ'ô¬(Œ÷s–˜úMûMÿM€N˜±(LÑ($Ö(úšüí(($ð(­  ­ ÷sÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ÷súM õ(
Œ$ú(üË*-LÎ*®  ® ÷s¿rÛ¼
 `£cûå `àB¤GS
± ¢çš ¶,š
$·,± ½,Td4hˆ D Àœž±ìD@œŸ´–7, Éœ µ–7Êœ µ“é2¦œ¡,uwacNP<-#„Ÿü7=: An event source that may be registered with [`Registry`].Áuúüy?< Types that implement `event::Source` can be registered withÁü¹IF `Registry`. Users of Mio **should not** use the `event::Source` traitÁüƒNK functions directly. Instead, the equivalent functions on `Registry` shouldÁ be used.Áßúüã&# See [`Registry`] for more details.ÁŠúüŽ)& [`Registry`]: ../struct.Registry.htmlÁ¸úü¼" # Implementing `event::Source`ÁßúüãOL Event sources are always backed by system handles, such as sockets or otherÁü³JG system handles. These `event::Source`s will be monitored by the systemÁüþLI selector. An implementation of `Source` will almost always delegate to aÁüËOL lower level handle. Examples of this are [`TcpStream`]s, or the *unix only*ÁŒ› [`SourceFd`].Á­úü±/, [`TcpStream`]: ../net/struct.TcpStream.htmlÁüá.+ [`SourceFd`]: ../unix/struct.SourceFd.htmlÁúü” # Dropping `event::Source`sÁ´úü¸OL All `event::Source`s, unless otherwise specified, need to be [deregistered]ÁüˆNK before being dropped for them to not leak resources. This goes against theÁü×OL normal drop behaviour of types in Rust which cleanup after themselves, e.g.Áü§ KH a `File` will close itself. However since deregistering needs access toÁüó 96 [`Registry`] this cannot be done while being dropped.Á­
úü±
=: [deregistered]: ../struct.Registry.html#method.deregisterÁï
ú
¤õ úü† :7 Implementing `Source` on a struct containing a socket:ÁÁ ú,  öüØ )& use mio::{Interest, Registry, Token};ÁÜ‚
 use mio::event::Source;Áäž
Á÷»
ú„¿

use std::io;ÁÐ
úÌÔ
 # #[allow(dead_code)]ÁÌî
 pub struct MySource {ÁÔˆ socket: TcpStream,ÁÏ©úô­ impl Source for MySource {ÁüÌVS fn register(&mut self, registry: &Registry, token: Token, interests: Interest)Áì£ -> io::Result<()>ÁüË74 // Delegate the `register` call to `socket`Áüƒ<9 self.socket.register(registry, token, interests)Á½ÊúüÎXU fn reregister(&mut self, registry: &Registry, token: Token, interests: Interest)Áì§³²Ù²üÏ96 // Delegate the `reregister` call to `socket`Áü‰>; self.socket.reregister(registry, token, interests)Á½ÒúüÖIF fn deregister(&mut self, registry: &Registry) -> io::Result<()> {Áü 96 // Delegate the `deregister` call to `socket`ÁüÚ,) self.socket.deregister(registry)ÁL‡½,‘Ï<—ßÒ¢¢ÎìüŸ ¢´¹´¹ £¤¥£¤¥£¤¥üŒˆü¶74 Register `self` with the given `Registry` instance.ÁòúüúKH This function should not be called directly. Use [`Registry::register`]ÁüÊKH instead. Implementors should handle registration by delegating the callÁìš to another `Source` type.Á¼úüÄC@ [`Registry::register`]: ../struct.Registry.html#method.registerÁD² ³  ² ¼¹ ³ ›j¦q³hñ𢠡¢
£¼¹Ýõ¹•üƒŠüš:7 Re-register `self` with the given `Registry` instance.ÁÙúüá41 This function should not be called directly. UseÁüš@= [`Registry::reregister`] instead. Implementors should handleÁüßKH re-registration by either delegating the call to another `Source` type.Á¯úü·GD [`Registry::reregister`]: ../struct.Registry.html#method.reregisterÁT†´ µ  ´ ¼¹ µ ›j¦q³hñ𢠚¢
¤¼¹Ýõ¹•üó@ü“96 Deregister `self` from the given `Registry` instance.ÁÑúüÙ4ß½ü’@= [`Registry::deregister`] instead. Implementors should handleÁü×C@ deregistration by delegating the call to another `Source` type.ÁŸúü§GD [`Registry::deregister`]: ../struct.Registry.html#method.deregisterÁTö·  ¶ ¼¹ · ›jñ𢠢
¥¼¹$†Ýü·7¥§§ÎìÙu ¼¢Ùu˜u¨©ª£¤¥ª¨©79üõ¸ ¹  ¸ ˜u ¹ ›j¦q³hñ𦠊 ¦
¨Ùu$ ÝD õ¹•üÀ!‰TÃ!º »  º ˜u » ›j¦q³hñð¦ ×!¦
©Ùu$Ü!ÝDê!õ,‡"¹•L"ü#?T#¼ ½  ¼ ˜u ½ ›jñð¦ #¦
ªÙu$¢#ÝD¨#”yô>d•é>ì>Ý>à>¤»Õ>ló 'R”Š
=R$¦
OROR`R`RdÆ
qRd˜•RdŠÌ Unix only extensions.Áú»¶¶”·Ô°ü§%$’¸Ù)Dä½ÕµÙ)+Då½Õµ Unix pipe.Áêúüö/, See the [`new`] function for documentation.Áæ Ê õºò6DÏÅ»Ï64ÙÁ¼„·79)+¤õôD„¡ô¸ # Mio's optional features.ÁÛúüã:7 This document describes the available features in Mio.Á¢úÄÑôË## `os-poll` (enabled)Á¼úüÄJG Mio by default provides only a shell implementation that `panic!`s theÁü“EB moment it is actually run. To run it requires OS support,
³hÈÈ!'<À  À ³hÇÇ
È…(Š
³h/3³hËÙËMOÁ  Á ³h³hÊŠÊ
˘P³hÍïßÍ"$ à   ³h à ³hÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ¿ßÀßÁßLessÁÂßÃßÄß~Å߯ßÇßGreaterÁÈßåºÝÈnûê7ÌÌ
Í#¹
*³hÏ»Ï!#Ä Å  Ä ³h Å ³hÈŽÎÎ
Ï~¹
„üŸk üë] Return a new `Poll` handle.Á“^úüŸ^GD This function will make a syscall to the operating system to createÁüï^GD the system selector. If this syscall fails, `Poll::new` will returnÁœ¿_ with the error.ÁÛ_úüç_UR close-on-exec flag is set on the file descriptors used by the selector to preventÁüÅ`FC leaking it to executed processes. However, on some systems such asÁü”aKH old Linux systems that don't support `epoll_create1` syscall it is doneÁüèaFC non-atomically, so a separate thread executing in parallel to thisÁü·bGD function may accidentally leak the file descriptor if it executes aÁü‡c-* new process before this function returns.Á½cúüÉc-* See [struct] level docs for more details.Áÿcúô‹d†à²dút¾d¤õÕdú<ádßÒäñd¬öü–e/ÒöäÎe use mio::{Poll, Events};Áäóe‚œ˜fúü¤f&# let mut poll = match Poll::new() {ÁÌÓf Ok(poll) => poll,ÁüõfHE Err(e) => panic!("failed to create Poll instance; err={:?}", e),Á4Æg };ÁÕgúüág2/ // Create a structure to receive polled eventsÁüœh1äúÖhúüâh<9 // Wait for events, but none will be received because noÁü§iGD // `event::Source`s have been registered with this `Poll` instance.Áü÷i>; poll.poll(&mut events, Some(Duration::from_millis(500)))?;Áü¾jæjë <ÿjÝ<kßÒ»Ø ˜)ˆ Ø)‚ ¦kÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
àiÂñCC
ÐTçkÐï¶Ñ‡·Ñ¤·ÑÑÐÑʸàỨ ˜5ˆ Ø5‚  Â Ù Ì Ø, Ú8!& ß8¼ ç ÷, è8
event_typeÁ& ó8´õ$ ø, ú8& ÿ8õ
$$ ,   Æ ,   §+  ˜ ¦, 8ê&  8û
¨, ª8& ¯8¼'·, º8flagÁ& ¿8¼$ Ç È, Ê Ë Í$ Ì
Î*Ú Ý Ò
8, ò8! ÷ ƒ, ø8ßž% 8$“8ט'8p,8
£, §8! ­ È8 ¿8× Šç
 Æ8$ Ë8± Í& Î Ð8Ñ8×Õ'Ø8ˆ ã:8ä æ(é8×ì'ï8Í ø º8Ž88 written_oneÁ\ ¢8 % ©, ¿ À , Ú Û æ+ Ü Ý å, Þ8ê
ç+   ž 8« ˆ  84‰ ' 8 bad_bit_maskÁd  Û  ì
8É
, Ì
8
 Ñ
 ê
  Ò
8
 ×
7ˆ Ø
$ Ù
 Û
, Ü
8
'â
, å
8Ñ 
 ì
 Ò
8Ž  8¤\’  ž  Á  8í2  É  Ê  å 8± Ë $ Ì 7û $ Ò 8Ô  Ý  Þ  ä , ß 8Ñ  - æ % ç 8¤\  8 $ % Ÿ 8  È  ´
8í2  ó  ô 
8± õ $ ö 7|{}Á $ ý 8ÔLÿ  ˆ


, Š
8Ñ $
-
%
 ƒ8 œ8¤\ © ì8í2 È É Ö8± Ê$ Ë7(empty)Á8 ó ¨8«    % Ó»Ø ˜6ˆ Ø6‚ ލëþ£Ù)Dà äµÙ)åµ™#ÜtûÅ×tüÆÒtýŽ ÍtàŒ“'Èt½Ó(ÃtÔßÓ(ÚtÕߤž ³ ¸ ¹ ß, º8 »& ½8¼,¿ Å Ý, Ç È Ó, É8argÁÊ& Í8$ Ô
Õ, × Ø Ú$ Ù
Û*á ä µ å ´+ ï ð 8« ö 8
unused_unsafeÁ88resÁ 8"4™   ¸8'¦, ¨8 © « , ¬ ­ ´, ®8”®¯$ ²
µ% ¹8Ã8Ó¯Æ Ê7ˆ Ì Î 8Ü ß ÿ8Àà'ã8“éå'ç8„ç'î8
last_os_errorÁ ý þ8$‹  ®8«ž   ¤8Ó¯¡% T‹
»Ø ˜7ˆ Ø7‚ /DÏ
Óìúûüý½Í“é ¦Öר $,ÖÙ¸<%«+ÖÚØ T.ÎNÖÛÖL:­+Öܪ
<Eö+ÖÝô,Nª+ÖÞ AtomicUsizeÁ\‡„ÄÖà®D”¼ÀÖáäè­ÖÖâEPOLLETÁ<Ä ñÖäEPOLLINÁ<Í ãÖåEPOLLOUTÁDÖ åÖæEPOLLPRIÁDà äÖç
EPOLLRDHUPÁTê íÖèˆ D„ÀÖê±–7,ŽÉÖëµ–7ÊÖ뵎 ÈyàŒµ µÖ¼Ó(¼yÔßÓ(ÏyÕß< \ýïòáäÓÖÅÈ·ºŒs¡¤œ£nqWZ?B'*
îðÜý„êÄä<„Öš C/êjîïñôÂÄü¬$³Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
êjÂñíí
îü/L”Æ  Æ êj’ºí ží
ïïï¶ð‡·ð¤·ððïð¶nêj êjü‘ V4˜ Ç È  Ç êj È …‰åïñðí Ÿ í
ñ$  ¨›ñ$™
ñï¶ò‡·ò¤·òòñòªðTñï¶ó‡·ó¤·óóñó …‰üÓVÉ  É êj¦q³hñðí ãí
ôÐ%êõ¹•ïôï¶õ‡·õ¤·õõôõð¾´/êj÷Ž,÷üº!Ê  Ê êjÎNÎNØ ÐNÐ%ä+ÑN›¾ä+§]òÞ^Ê ö Ãö
÷Ìÿ/êjù¬+ùäŸË  Ë êjø ¬ø
ùüã1”æÖ³h
ú¹•°¤÷…‰/ôƒˆŠ×ÿ¤,ýþ™#T€ûýÿÕ–7,¯ Éýµ–7Êýµ ©€d¨ @ü» $Ì  Ì °¤¦q Ï 
Æü!)\!Í  Í °¤ ©!
Æ,¢!üÄ")\Ë"Î  Î °¤ Þ"
ƒÆ,×"ü·#&D¾#Ï  Ï °¤ Î#
Æ,Ç#ü§$,t®$Ð  Ð °¤ Ä$
Æ,½$ü˜'-|Ÿ'Ñ  Ñ °¤ ¶'
Æ,¯'üõ*)\ü*Ò  Ò °¤ +
Æ,ˆ+üè+ 4ï+Ó  Ó °¤ ù+
ˆ ö+üÚ, 4á,Ô  Ô °¤ ë,
 è,ü°-Nl·-Õ Ö ×  Õ  c cˆ¢cµ
 `£cûå `àB¤GS
Ö  × °¤¢ç È-
б Å-Æ,á-ü¾.6dÁ.ýØ Ù  Ø  Ù  Ó.
gotÁÎ.wantÁ$Ù.ô³6I„tì
»Ø y w /,ðÓàFileÁ$
Ž“é$!¦ŽReadÁ$'à ŽWriteÁ,-Ÿ!ޏ<i«+ŽÖLr­+Žô,}ª+Ž“'D˜Õˆ D„ÀŽš±–7,ŽÉ޵–7ÊŽµlþ<îÛÝÆÈ\[¹»©«›¤âvxacTþ/økžŸ¡¢£¤üÔIâÚ  Ú êj¦qÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
økÂñœ ðœ
ûõüº5„ȄМœ
žüÄ + Û  Û økñðœ × œ
Ÿ  ¤¿rü¢"Ü  Ü økœ ¾œ
¡$¿ü¶(ÄÝ  Ý økÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙœ Çœ
¢ü—"Þ  Þ økœ «œ
£üé!Žß  ß økñðœ òœ
¤ §¿r´‘/øk§¬+§ä®à  à øk¦ »¦
§d— »Ø ZX»¶¶”þÔø/D› Óäå“é ¦¨©ô,@ª+¨ªÆ,–i¨¬ˆ DÀ¨­±ì@¨®´–7,±É¨¯µ–7ʨ¯µ<Ÿ”3rt]_IKüŠ'/Œ±±·l²³´£¤¥³´²ü¸á â  á ·l â ›j¦q³hñð° Ͱ
²ŒÝõ¹•L“üTã ä  ã ·l ä ›j¦q³hñð° ¤°
³ŒÝõ¹•üæ?å æ  å ·l æ ›jñð° ô°
´ŒÝDÿÄÐ œ‡,»Ø " »¶¶”ž# mio_unsupported_force_waker_pipeÁüó# Àñüþ$úfreebsdÁ¬È%úiosÁŒó%úmacosÁœš&útvosÁ”Ã&úvisionosÁ´ë&úwatchosÁ¬—'ü²%ü¤$ªú Œ£(ú dragonflyÁ¼Â(ú½òœç(úÜò”ˆ)únetbsdÁ¤¨)úíòŒÊ)úopenbsdÁ¬é)úredoxÁœŒ*Àñü±*úŸ ¬Ò*ü°*8ú± ”ö*úŠó¤–+üÄ"ñúî¤Ã+´Â+úŠ”æ+¤å+ü·"É ü®"Ô /$–,¹õÀÁÅ“éM¦·ô,bª+¸ôËÞIoSliceÁ<ÙæLà
IoSliceMutÁTâö á¡Ìà â¹ÌŸ!㨠,å¸<”«+æØ TÎNçÖ­+èŒ
¯+éª
<¿ö+ê®o\ÜÞ1ìãlTéº1íën\õÎ1îÿ9DšïÆiñˆ D·Àò±ì@ó´–7,ËÉôµ–7Êôµ<Hî”Uàüj1<xÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¿rÂñ
¹ ˜¿r ·¿rœÂ2eêj%†¥-¾¿„âÄÜùÖ½½¿r\ˆˆÖ½½¶n(9º?êjÁÀcÁ!#ç è é  ç êj è  c cˆ¢cµ
 `£cûå `àB¤GS
é ¢çÀÀ
ÁıÊü˜X»¶¶ »“*x=Ê ø=µ % ø=¬ 0 ê  ê êj¦q³hñðí ªí
ÂÐ%±õ¹•Âï¶Ã‡·Ã¤·ÃÃÂÃð¾üÉ5»¶¶ý»“*ú÷óë  ë êjñðí Ûí
ÄÐ%âõÄï¶Å‡·Å¤·ÅÅÄÅ𾻓*x@Ö ú»¶¶@ñ Ð@ê ø@Õ 0 ø@Ì ; 7êjÇÌÚ„¿Ĺáì  ì êj¿rÆ äÆ
Ç6P8lÒ/ý¿kbkåêm,úÀÉÊ¿k6P6ý¿kÈÈ
ÉXAøýÈÈÈA“8¿kÌÀcÌøA¿8í î ï  í ¿k î  c cˆ¢cµ
 `£cûå `àB¤GS
ï ¢çËË
̱¼é6»“*x¤Ö ú ¤ë »¶¶¤ñ Фê ø¤Õ 0 ø¤Ì ; 9œí6ÖÔÕ“éW¦ÍÎô,lª+Íψ D€ÀÍѱì@ÍÒ´–7,”ÉÍÓµ–7ÊÍÓµ<R‹”_|,xmoXZD9l¯ÔÔÕÓ( ýH Š©
T ýH Š©
T ÕQLÔÔ¶ñ”¿9¶ñרÜÝÞüØ$æ¶ñÖÖ
×ü tñ ò  ñ ¶ñ ò ÙuÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
£ÂñÖ¥ÙÚ£ÛÛÙÚ ½ÖÍìÙu ´Íì°ó ·Íìô ºð –"°ó ð ÙuÜøð °óõ˜"Áól†
ØÙu°óô± Ä“éÊŽŠŒˆüŒ¥ó ô  ó ¶ñ ô ›j¦q³hñðÖ ¬Ö
ÜÝD¿õ¹•Ð%ü¬§õ ö  õ ¶ñ ö ›j¦q³hñðÖ ÎÖ
ÝÝõ¹•L”Ð%±üÐU÷ ø  ÷ ¶ñ ø ›jñðÖ éÖ
ÞÝÐ%ü•7"‚š¼Ó:,åøkœ÷Ö³^úáñŽààôËÓõýmï˜"ù.»Ë¤økãÀcã#%ù ú û  ù øk ú  c cˆ¢cµ
 `£cûå `àB¤GS
û ¢çâ¥Ëâ
ãDZ̓PüºHE Adapter for [`RawFd`] providing an [`event::Source`] implementation.Áƒúü‡EB `SourceFd` enables registering any type with an FD with [`Poll`].ÁÍúüÑIF While only implementations for TCP and UDP are provided, Mio supportsÁü›NK registering any FD that can be registered with the underlying OS selector.Áüê-* `SourceFd` provides the necessary bridge.Á˜úüœLI Note that `SourceFd` takes a `&RawFd`. This is because `SourceFd` **doesÁüéHE not** take ownership of the FD. Specifically, it will not manage anyÁü²PM lifecycle related operations, such as closing the FD on drop. It is expectedÁüƒ=: that the `SourceFd` is constructed right before a call toÁüÁ=: [`Registry::register`]. See the examples for more detail.Áÿúüƒ1. [`event::Source`]: ../event/trait.Source.htmlÁüµ!ü‚ü×C¹»ú¤õ® ú„² 
Basic usage.ÁÃ ú, 

öä– ¬öü³ /Òöüã %" use mio::{Interest, Poll, Token};Á„‰ 
#[cfg(unix)]Áäš  use mio::unix::SourceFd;Áô·  #[cfg(target_os = "wasi")]ÁäÖ  use mio::wasi::SourceFd;Áó úì÷  use std::os::fd::AsRawFd;Áô•
 use std::net::TcpListener;Á´
úÔ¸
 // Bind a std listenerÁüÓ
52 let listener = TcpListener::bind("127.0.0.1:0")?;Áúä➪úä® // Register the listenerÁìË‹ëüé-* &mut SourceFd(&listener.as_raw_fd()),ÁŒ—Ðë쩲 „Çë ÝßÒèúüìKH Implementing [`event::Source`] for a custom type backed by a [`RawFd`].Á¸úöüÕ0- use mio::{event, Interest, Registry, Token};Á„†ǃä—àƒô´…„äÓ¬„ðúÜô use std::os::fd::RawFd;Á‡°¡úÌ¥¬°¬¿ pub struct MyIo {Á”Õ fd: RawFd,ÁÏîúüò! impl event::Source for MyIo {Áü”VÔ±ìë³²L‰Ù²ü“C@ SourceFd(&self.fd).register(registry, token, interests)ÁL×½áúüåXŒ´ì¾³²Ù²üæEB SourceFd(&self.fd).reregister(registry, token, interests)Á½úüºI¬¶ü„30 SourceFd(&self.fd).deregister(registry)ÁL¸½ÏßÒ<DìŒææ·lfÃÂ_ܲ®åç Œ·lƒPJè·lää
åŒõääèÙ¥Œéé·lêÀcêNP46ü ý þ  ü ·l ý  c cˆ¢cµ
 `£cûå `àB¤GS
þ ¢çè§Ùè
êŒß±å<‚!»“*x¨  ¸¨š =†!Óôõöûý“é ¦ëìš< ÀëíIpv4AddrÁD3¾ºëïIpv6AddrÁD=̺ëð
SocketAddrÁTG“¼ëñ SocketAddrV4ÁdSª¼ëò SocketAddrV6Áda½¼ëó<ÃŒ´D(ŸikLN/1üqbl“¼”¼•¼V4Á–¼ˆ—¼˜¼V6Á™¼ˆ cÌ£•Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Âñ
ôaddrÁ$ socket_typeÁ\Ÿü¤bÁ•
õdomainÁ4½³•üÓ =|äööí*÷„+ëøŽ+ëø¹'‡,ä¾ïø¹'‡,ä¾ï÷ø¬úúëööãã sockaddr_inÁä
sin_familyÁåsin_portÁæsin_addrÁçsin_zeroÁÅì`0 o$´•ëööðð sockaddr_in6Áñ sin6_familyÁò sin6_portÁó
sin6_flowinfoÁô sin6_addrÁõ
sin6_scope_idÁ£1PÛv㪤°=§—úüË4ÿ  ÿ §— ØØsockaddrÁÙ sa_familyÁÚsa_dataÁ.çÞ›÷È=ù àù
úüþR
 
í”§— ž
û§• ëûû¿rü7lt²7 ËËsockaddr_storageÁÌ ss_familyÁÍ __ss_pad2ÁŒÏ
__ss_alignÁŒ‡^³bAÉ CÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
í”Âñ
ýstorageÁ<Æ7””!»“*=í­Ž“é ¦þÿš< Àþ MaybeUninitÁ\%ÑÛþ“*$Bž"þÎ’TH“¼þ¸<‰«+þÖL’­+þˆÛ*TŒ õþŠ«+\˜ ûþÃ+t¥ ýþŒ<ÛDÌα³D7£<•\{tv¬ôgiVXEGü·Jí”Á•
˜ü²Q
 
Àxí”ñð Í
ŽsocketÁ4ŧ•ü›R
 
«zí”ñð ¹
™¡§•üŒ
O
ƒ
 ƒ
Àxñð ©

™¡
backlogÁ<¼
ü  Y 
 
Àxñð Ä 
™¡  reuseaddrÁL× üŸ]4­
 
ÀxÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
«zí”Âñ ¾
‰/D´ï¶‡·¤·ó¾«z4µ'ﶇ·¤·í”Ï¥«z”°!»“*

=¡¢“é ¦íë“*$*ž"Î’T0“¼š¸<q«+œÖLz­+Æ*lô ôŸ«+\ƒ û <¤D•D$vx\chjXZ¬ÜLN;=ü’;$™í”Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
è{Âñ
¡§•üÍB
 
è{Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Âñ ë
¢™¡"»“*­ ª úî¤Ú!úŠ”ð!üÙ!*üÕ!/üÌ!:=…´¬¹ÎØÙÚÛ 
l}ö,£¤OsStrExtÁD¤Ï$£¥Ö­+£¦Î’þM£§“éþ¦£©í룪µ £«üh"ä‡ä²xôÔhøXZGI68¼Ž=D·¸“é ¦¬­¸<«+¬¯ÖL(­+¬°“*$Mê%¬²Î’TSþM¬³Û*T| õ¬´ú0L£ Ú¬µ<Ž\oq”8bGRTüe!FüŒ 9ü¯N
 
þMþMÎ’ÿM§•ê%€Nê%è)6{}š~ÉÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
}Âñ Ð
˜üú8<ˆµ°
·ü©JÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
}}Âñ
¸¼§=D¶ËÌOsStrÁ,ˆ¹º¸<'«+¹¼ÖL0­+¹½Ò«DTÏ$¹¾“*$wê%¹ÀÎ’T}þM¹ÁPathÁ$™…0¹Â“驦¹Äí­ë¹Å¬STĺ¹Æû÷Û*Të õ¹Çç0\“ Ù¹Éú0L  Ú¹Ê|\ þä@ñ”bâqÒÔ|ŽÂ£²´¡£´¸”üÔ!~¬ûoq^`ü­Nˆ
 ˆ
ù¯Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¾~Âñ Î
˘ü² Z 
 
¾~Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
žù¯Âñ Ñ 
̉/DÇ Ìï¶Í‡·Í¤·ÍÍÌÍ󾩀¬À=4ÏÖ×“é ¦ÎÏÖL­+ÎГ*$Bê%ÎÒÎ’THþMÎÓÛ*Tq õÎÔú0L˜ ÚÎÕ<z´k”-\<LNüZ! 3ü¤OŠ
 Š
ù¯Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
©€Âñ È
Ö˜<¿üÍFÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
©€©€Âñ
×䨣 ü¾5£
 
ÀÀ sockaddr_unÁÁ
sun_familyÁÂsun_pathÁ{öËʾ6w¿r ×
Ùÿ™ü°J£Œ
 Œ
ù¯¯½ Æ
Ú˜ü¿L£Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ÙuÙuÂñ¥ÜÜÛô Ç­+ÙuL
ÛÙuflagsÁ,Ê(* ÃÛÛ¿rd0<ÏO0R06090&0)000\€ 00ü/ÿ/í/ð/Þ/á/Ï/Ò/À/Ã/d͵/¸/¦/©/—/š/ÔˆŒ/,¨~//p/s/]/`/K/N/üê4.üÔ(% Create a new non-blocking Unix pipe.ÁýúüNK This is a wrapper around Unix's [`pipe(2)`] system call and can be used asÁüÐ2/ inter-process or thread communication channel.Áƒúü‡PM This channel may be created before forking the process and then one end usedÁüØPM in each process, e.g. the parent process has the sending end to send commandÁÌ© to the child process.ÁÃúüÇUR [`pipe(2)`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.htmlÁú # EventsÁ®úü²JG The [`Sender`] can be registered with [`WRITABLE`] interest to receiveÁüýPM [writable events], the [`Receiver`] with [`READABLE`] interest. Once data isÁüÎLI written to the `Sender` the `Receiver` will receive an [readable event].ÁúüŸPM In addition to those events, events will also be generated if the other sideÁüðHE is dropped. To check if the `Sender` is dropped you'll need to checkÁü¹KH [`is_read_closed`] on events for the `Receiver`, if it returns true theÁü…MJ `Sender` is dropped. On the `Sender` end check [`is_write_closed`], if itÁüÓOL returns true the `Receiver` was dropped. Also see the second example below.Á£úü§$! [`WRITABLE`]: Interest::WRITABLEÁüÌ0- [writable events]: event::Event::is_writableÁüý$! [`READABLE`]: Interest::READABLEÁü¢/, [readable event]: event::Event::is_readableÁüÒ41 [`is_read_closed`]: event::Event::is_read_closedÁü‡63 [`is_write_closed`]: event::Event::is_write_closedÁ¾úœÂ # DeregisteringÁÖúüÚIF Both `Sender` and `Receiver` will deregister themselves when dropped,Áü¤EB **iff** the file descriptors are not duplicated (via [`dup(2)`]).ÁêúüîSP [`dup(2)`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.htmlÁÂú¤õÕúüÙMJ Simple example that writes data into the sending end and read it from theÁ”§ receiving end.ÁºúßÒüÆ%" use std::io::{self, Read, Write};Áìúüð-* use mio::{Poll, Events, Interest, Token};ÁÄž use mio::unix::pipe;Á·úü»52 // Unique tokens for the two ends of the channel.Áüñ&# const PIPE_RECV: Token = Token(0);Áü˜ &# const PIPE_SEND: Token = Token(1);Á¿ úüà #´óüç =: // Create our `Poll` instance and the `Events` container.Áü¥! ºúüÆ!.+ let mut events = Events::with_capacity(8);Áõ!úÌù! // Create a new pipe.Áü“"2/ let (mut sender, mut receiver) = pipe::new()?;ÁÆ"úüÊ")& // Register both ends of the channel.Áüô"LI poll.registry().register(&mut receiver, PIPE_RECV, Interest::READABLE)?;ÁüÁ#JG poll.registry().register(&mut sender, PIPE_SEND, Interest::WRITABLE)?;ÁŒ$úü$*' const MSG: &[u8; 11] = b"Hello world";Á»$úT¿$ÃþüÊ$&×þñ$úüõ$$™øüš%!Ûùü¼%.+ PIPE_SEND => sender.write(MSG)Áüë%52 .and_then(|n| if n != MSG.len() {Áü¡&LI // We'll consider a short write an error in thisÁüî&KH // example. NOTE: we can't use `write_all` withÁüº'0- // non-blocking I/O.Áüë'@= Err(io::ErrorKind::WriteZero.into())Áü¬(  } else {ÁüÍ(" Ok(())Á
 
ýlñðö ê8ö
÷$ë8
\ñ8üùJaüà9JG Execute an I/O operation ensuring that the socket receives more eventsÁü¯:&# if it hits a [`WouldBlock`] error.ÁÚ:ú\â:÷àò:úüú:FC This method is required to be called for **all** I/O operations toÁüÅ;LI ensure the user will receive events once the socket is ready again afterÁü–<%" returning a [`WouldBlock`] error.ÁÀ<úüÈ<-* [`WouldBlock`]: io::ErrorKind::WouldBlockÁú<út=¤õ•=ú<=ßÒä©=¬ö,Ê=ЄüÔ=/Òö„ˆ>‡°ì>݄Ŀ>âÒÜ>úüä>*' let (sender, receiver) = pipe::new()?;Á“?úü›?+( // Wait until the sender is writable...ÁË?úüÓ?B? // Write to the sender using a direct libc call, of course theÁüš@96 // `io::Write` implementation would be easier to use.Á¼Ø@ let buf = b"hello";Áôô@ let n = sender.try_io(|| {Áü—A30 let buf_ptr = &buf as *const _ as *const _;ÁüÏAQN let res = unsafe { libc::write(sender.as_raw_fd(), buf_ptr, buf.len()) };Á´¥B if res != -1 {ÁäÀB Ok(res as usize)Á„áB
} else {ÁüöBJG // If EAGAIN or EWOULDBLOCK is set by libc::write, the closureÁüÅC0- // should return `WouldBlock` error.ÁüúC+( Err(io::Error::last_os_error())ÁLªD½D¸D })?;ÁüÅD# eprintln!("write {} bytes", n);ÁíDúüõD-* // Wait until the receiver is readable...Á§Eúü¯EEB // Read from the receiver using a direct libc call, of course theÁüùE85 // `io::Read` implementation would be easier to use.ÁܶF let mut buf = [0; 512];ÁüÖF  let n = receiver.try_io(|| {ÁüûF30 let buf_ptr = &mut buf as *mut _ as *mut _;Áü³GRO let res = unsafe { libc::read(receiver.as_raw_fd(), buf_ptr, buf.len()) };Á´ŠHöä¥H­ö„ÆHÓöüÛHIF // If EAGAIN or EWOULDBLOCK is set by libc::read, the closureÁü©I0Ã÷üÞI+þ÷LŽJ½DœJÁøü©J" eprintln!("read {} bytes", n);ÁdÐJÒÛ<áJÝ<íJßÒ4€KŽ
 Ž
ýlÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¥Âñöù¥úúù KöÍì‚€ ‡KÍìÕ€ ŠK–"‚€ÌÀK‚€˜"‡€lÌK
ø‚€Õ€$ŽK± ”KZ\VXúKøï¶û‡·û¤·ûûøû‚€Õ€ ÿù‡€‚€ìŒL»¶¶Ó Ð >ýlýþÿ£¤¥ÿýþü°L‡D³L

 
ýl 
›j¦q³hñðü ÅLü
ý$ÊLÝDØLõ,õL¹•L‹MüýM‰T€N

 
ýl 
›j¦q³hñðü ”Nü
þ$™NÝD§Nõ,ÄN¹•LÚNüÎO?TÑO

 
ýl 
›jñðü ÜOü
ÿ$áOÝDçO¬ÁP»¶¶Œ

>ýlƒ !¡!¤!ƒüÝP4,àP

 
ýl 
Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
¿rÂñ æP
$ëPûåñPd­Qﶇ·¤·õ‚·ƒüØQGtÛQ
˜

 
ýl ˜
æLæLçLŒßéLˆ¦ —óë@M$T
· êQ
ƒ$ïQbufsÁ$õQd»Rƒï¶‡·¤·ƒ¢‰ 
æLæLçLŒßéLˆ¦ —óë@M$TüðR%,óRš
 š
ýlñð ùR
$þRd±Sﶇ·¤·õ‚ñð´×S»¶¶ûø>8

ÆmˆŠŒ !¡!¤!ŒˆŠüôS4,÷Sœ

 œ
Æm 
· ýS
ˆ8$‚TûåˆTdÄTˆï¶‡·¤·ˆ¢‰±‰üïTGtòTž
Ÿ
 
 ž
Æm Ÿ
æLæLçLŒßéLˆ¦ —óë@M$T 
· U
Š8$†U܉$ŒUdÒUŠï¶‡·¤·Š¢‰À‹ü‡V%,ŠV¡
 ¡
Æmñð V
Œ8$•VdÈVŒï¶‡·¤·Œ¤ü¶W \îV÷àúVúüþV74 The underlying pipe is **not** set to non-blocking.Á»¶¶IF>ýlëüÝW$$àWÙmýlŽŽ
stdinÁ,åWÌ–Y»¶¶¿¼>ýl®+ü¶Y*\ÀYýl
Ð%ÌY¼ÀZ»¶¶0->ýl“¬+äÞZLáZ¢
 ¢
ýl ëZ
$ìZÌ¥[»¶¶²¯>ýl•°+ìÅ[\È[ýl
$Ô[ìœ\»¶¶!>¶n—ëüÀ\$Ã\ýl¶n
senderÁ4È\¤”]»¶¶˜>ýl™Ž,ü¯]!,²]£
 £
ýlÎNÎNØ ÐNÐ%ä+ÑN›¾ä+§]òÞ^£
˜ ¸]˜
$¹]ì÷]»¶¶\Y>ýlëä›^$ž^¶nýlšš
Ð%£^l³`»¶¶ÌÉ>…ožü„aBüÇ`85 Set the `Receiver` into or out of non-blocking mode.Á|a¤
 ¤
…oñ𜠛aœ
$œa
\¢aüªsaü‘bJ²íüàb&‡îcú\“c÷à£cúü«cFàîüöcL±ïüÇd%ˆðñdúüùd-Åð«eút³e¤õÆeú<ÎeßÒäÚe¬ö,ûeЄü…f/Òö„¹f‡°ìÎfÝ„ÄðfâÒgúü•g*•òÄgúüÌg+×òügúü„hBšóüËh9çó¼‰iªôô¥iËôüÈi3ôôü€jQ²õ´Öjöäñj­ö„’kÓöü§kJîöüök0Ã÷ü«l+þ÷LÛl½DélÁøüöl#Ôøžmúü¦m-ùØmúüàmEÔùüªn8¤úÜçnæúü‡o Œûü¬o3·ûüäoRõû´»pöäÖp­ö„÷pÓöüŒqIüüüÚq0Ã÷ür+þ÷L¿r½DÍrÁøüÚr"ŠþdsÒÛ<sÝ<žsßÒ4±s¥
 ¥
…o‚€‡€œŸ¥ Ÿ  ¾sœ ¸s£ »s´ÌñsÇlýs
ž‚€Õ€$¿s± Ås8:=?«tžï¶¡‡·¡¤·¡¡ž¡‚€Õ€ð‚ˆƒü½t»¶¶%">…o£¤¥£¤¥¥£¤üãt‡Dæt¦
§
 ¦
…o §
›j¦q³hñð¢ øt¢
£$ýtÝD‹uõ,¨u¹•L¾uü°v‰T³v¨
©
 ¨
…o ©
›j¦q³hñð¢ Çv¢
¤$ÌvÝDÚvõ,÷v¹•Lwüx?T„xª
«
 ª
…o «
›jñð¢ x¢
¥$”xÝDšx´ôx»¶¶ÞÛ>…o§©á â §©ü‘y7$”y¬
­
 ¬
…o ­
·¦ ™y¦
§$žyûå¤ydäy§ï¶¨‡·¨¤·¨¨§¨¢‰ üŽzMl‘z®
¯
°
 ®
…o ¯
ö ö ÷ ¨ßù ˆ¦ èóÇãp9ܰ
·¦ Ÿz¦
©$¤z܉$ªzd÷z©ï¶ª‡·ª¤·ªª©ª¢‰ 
ö ö ÷ ¨ßù ˆ¦ èóÇãp9ܼ©{»¶¶+!(!>8±
±
Îo¬®á â ®¬üÇ{7$Ê{²
³
 ²
Îo ³
·« Ï{«
¬8$Ô{ûåÚ{dš|¬ï¶­‡·­¤·­­¬­¢‰œ«üÄ|MlÇ|´
µ

 ´
Îo µ
ö ö ÷ ¨ßù ˆ¦ èóÇãp9Ü
·« Õ|«
®8$Ú|܉$à|d­}®ï¶¯‡·¯¤·¯¯®¯¢‰«­ü§~#\ß}÷àë}úüï}7Ñ’»¶¶ƒ#€#>…o±ë±üÑ~($Ô~áo…o°°
±stdoutÁ4Ù~üÚ€#\’€÷àž€úü¢€7Ñ’»¶¶)$&$>…o³ë³ü„($‡¤p…o²²
³stderrÁ4ŒÜÅ‚»¶¶¤$¡$>…oµ°+µìç‚\ê‚…o´´
µ$ö‚̾ƒ»¶¶%%>…o·¬+·äÞƒLჷ
 ·
…o ëƒ
·$ìƒÜ¥„»¶¶ž%›%>…o¹®+¹üÇ„,\Ñ„…o¸¸
¹Ð%Ý„üÕ…»¶¶&&>¶n»ë»üû…#$þ……o¶nºº
»ç Dƒ†´Õ†»¶¶‰&†&>…o½Ž,½üò†!,õ†¸
 ¸
…oÎNÎNØ ÐNÐ%ä+ÑN›¾ä+§]òÞ^¸
¼ û†¼
½$ü†üº‡»¶¶S'P'>…o¿ë¿äà‡$ㇶn…o¾¾
¿Ð%è‡ü½‰B»¶¶È'Å'ú Œåˆú ¬øˆúŸ ¬ú± ”¦‰üäˆUüàˆZü׈e|À‰ñð
ÀÐ%Љ
\Û‰ŒÔ7üç6  Sending end of an Unix pipe.Áˆ7úüŒ763 See [`new`] for documentation, including examples.Á»¶¶ç(ä(·4ß7ýlª"ŒmÞªþ¬ì7,ì7ÁÁÿ9ƒºðÓð§:ð™]”Õ·ÿùÌ7¹ýlÄÀcÄ#%¹
º
»
 ¹
ýl º
 c cˆ¢cµ
 `£cûå `àB¤GS
»
¢çüÌ7Ã
ÄDZ͜ÿ_ü_" Receiving end of an Unix pipe.Á³_úü·_6ð»»¶¶¡*ž*¸DŠ`…o)¯0â|íÃMƬ™`,™`ÅÅú½÷_º…oÈÀcÈ#%¼
½
¾
 ¼
…o ½
 c cˆ¢cµ
 `£cûå `àB¤GS
¾
¢çǽ÷_Ç
ÈDZÍQü85 Associates readiness events with [`event::Source`]s.Á9úü=EB `Token` is a wrapper around `usize` and is used as an argument toÁüƒ85 [`Registry::register`] and [`Registry::reregister`].Á¼úüÀ3öôúüø0Ÿóô©¤ÉüÈ@= [`Registry::register`]: struct.Registry.html#method.registerÁü‰DA [`Registry::reregister`]: struct.Registry.html#method.reregisterÁÎú
# ExampleÁàúüäMJ Using `Token` to track which socket generated the event. In this example,Áü²EB `HashMap` is used, but usually something like [`slab`] is better.Áøúüü+( [`slab`]: https://crates.io/crates/slabÁ¨úö俬öüÜ/ÒöüŒ2½åü¿3úåüó-* use mio::{Events, Interest, Poll, Token};Áô¡ use mio::net::TcpListener;ÁÀú¤Ä§œôÙ use std::io::{self, Read};Áüø" use std::collections::HashMap;Á úüŸ JG // After this number of sockets is accepted, the server will shutdown.Áüê " const MAX_SOCKETS: usize = 32;Á
úü‘
NK // Pick a token that will not be used by any other socket and use that oneÁÄà
 // for the listener.Áüù
(% const LISTENER: Token = Token(1024);Á¢ úü¦ ! // Used to store the sockets.ÁüÈ %" let mut sockets = HashMap::new();Áî úüò ;8 // This is used to generate a unique token for a socketÁü® " let mut next_socket_index = 0;ÁÑ úÔÕ  // The `Poll` instanceÁüð ºú
úœ•
 // Tcp listenerÁü©
B? let mut listener = TcpListener::bind("127.0.0.1:0".parse()?)?;Áì
úäð
½†üKH poll.registry().register(&mut listener, LISTENER, Interest::READABLE)?;ÁÙúüÝJG // Spawn a thread that will connect a bunch of sockets then close themÁü¨&# let addr = listener.local_addr()?;ÁÜÏÿèüë  use std::net::TcpStream;ÁŒúüNK // +1 here is to connect an extra socket to signal the socket to closeÁüß%" for _ in 0..(MAX_SOCKETS+1) {Áü…+( // Connect then drop the socketÁü±63 let _ = TcpStream::connect(addr).unwrap();Á½Ïéúú¤þ // Event storageÁü“1äúÅúüÉ74 // Read buffer, this will never actually get filledÁÜ let mut buf = [0; 256];ÁúÔ¡ // The main event loopÁÃþÔÇ // Wait for eventsÁüâ&×þúô’ÿü¬!ÛùìÎ LISTENER => {ÁüìIF // Perform operations in a loop until `WouldBlock` isÁü¶# // encountered.ÁÔÚ loop {Áüõ1. match listener.accept() {Áü§41 Ok((mut socket, _)) => {ÁüÜ63 // Shutdown the serverÁü“EB if next_socket_index == MAX_SOCKETS {ÁüÙ2/ return Ok(());ÁüŒ!®úü²?< // Get the token for the socketÁüòEB let token = Token(next_socket_index);Áü¸74 next_socket_index += 1;ÁðúüôB? // Register the new socket w/ pollÁü·b_ poll.registry().register(&mut socket, token, Interest::READABLE)?;Ášúüž30 // Store the socketÁüÒ>; sockets.insert(token, socket);Áì‘ü¯TQ Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {Áü„NK // Socket is not ready anymore, stop acceptingÁüÓ&# break;ÁìúÖßü˜KH e => panic!("err={:?}", e), // Unexpected errorÁÌä¬þÈ€Œ”æ€Ô¦ token => {ÁüÁ/, // Always operate in a loopÁÔñŠØüŒ OL match sockets.get_mut(&token).unwrap().read(&mut buf) {ÁüÜ &# Ok(0) => {Áüƒ!KH // Socket is closed, remove it from the mapÁüÏ!74 sockets.remove(&token);Áü‡"&³áì®"ÖßüÌ"HE // Data is not actually sent in this exampleÁü•#41 Ok(_) => unreachable!(),ÁüÊ#TýßüŸ$LI // Socket is not ready anymore, stop readingÁüì$&³áì“%Ößü±%KðáÌý%Ä⬗&È€Œ­&æ€l¿&§LÍ&½,×&Ï<Ý&Ý<å&ßÒ,¼'¦q` ç åµ'ÊË¿r¦qQ4¿r¦qÉÉ
ÊLÂ'ÉÉ¿r Àö&»¦qü&¼¦q15¼¦qÏÙÏPR¿
 ¿
¦q¦qÎÁü&Î
Ïœ(ƒ'½¦qÑÀcÑ#%À
Á
Â
 À
¦q Á
 c cˆ¢cµ
 `£cûå `àB¤GS
Â
¢çЃ'Ð
ÑDZÍHÊ'¾¦q¾¦qÔ·ßÔ8:Ã
Ä
 Ã
¦q Ä
¦qÓÊ'Ó
Ô¹
šÄ•'¿¦qÖÖ#)>Å
 Å
¦qÕÄ•'Õ
Öˆ™'À¦qØïߨ$&Æ
Ç
 Æ
¦q Ç
¦qƒŽ×Å™'×
ع
ˆÆ¥'Á¦qÚ»Ú#%È
É
 È
¦q É
¦qÈŽÙÆ¥'Ù
Ú¹
‡ Ǫ'¦qÜ›eÜ#%Ê
Ë
 Ê
¦q Ë
ùÛùÝÝǪ'ÛÍì¼ó˜¢e¼ó¦
ܼ󴺺¼¾„€ü21. Waker allows cross-thread waking of [`Poll`].ÁdúühIF When created it will cause events with [`readable`] readiness and theÁü²IF provided `token` if [`wake`] is called, possibly from another thread.Áüúô€¤ÉüŸ>À•üÞ+( [`wake`]: struct.Waker.html#method.wakeÁŠú÷àšúüžNK `Waker` events are only guaranteed to be delivered while the `Waker` valueÁ
is alive.ÁûúüÿNK Only a single `Waker` can be active per [`Poll`], if multiple threads needÁüÎIF access to the `Waker` it can be shared via for example an `Arc`. WhatÁü˜GD happens if multiple `Waker`s are registered with the same `Poll` isÁ„à