Files
boc/aamos-command-center/target/release/deps/libtower-7e99bbee0354f17e.rlib
T

76 lines
38 KiB
Plaintext
Raw Normal View History

!<arch>
/ 0 0 0 0 8 `
// 60 `
tower-7e99bbee0354f17e.tower.8c57441a1ee5275e-cgu.0.rcgu.o/
lib.rmeta/ 0 0 0 644 37552 `
ELF·0@@GNUÀ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Á tower_layerÁ?ܰ®¢‚VyJT;Öiæð`-037597086710a3adÁ
tower_serviceÁ_ i²yÆúÕ8'ø6K©-426a99b575f4adedÁ
opaque_futureÁl|»utilÁ„» spawn-readyÁ¼%»filterÁ”B»makeÁ„Zü cbalanceÁ<â:» œ‘:bufferÁ4À;»­ ”ñ:discoverÁD¡<»É ¤Î;î4€=»î”±<hedgeÁ,Û=»ý ŒŽ=limitÁ,µ>»˜
Œè=¬$?»¬„Â> load_shedÁLî?» load-shedÁ¬™?ÿ$Ë@»ÿ„€@ ready_cacheÁ\°A» ready-cacheÁ¼×@ reconnectÁL˜B»³ ¬ÃAretryÁ,öB»Ò Œ©B spawn_readyÁ\ÜC»Ø¼ƒCsteerÁ,¼D»Ž ŒïCtimeoutÁ<šE»© œÉDÉ$ôE»É„©E
service_fnÁT‰G»É„¢F
ServiceExtÁT•G»É " MakeServiceÁ\ÇH»ÿ„àGÀmacrosÁbuilderÁ >
æ layerÁ¥layer_fnÁ
into_innerÁserviceÁ¤ check_cloneÁcheck_service_cloneÁ¤
check_serviceÁ¤¥¦  ×#¤##ServiceÁ#žž(((((É---sealedÁ4SealedÁ5¥BoxErrorÁServiceBuilderÁ88ž;;ƒ
"
"
"
'
=
5Ø88ï:žºTþOrpë³88ï:žºTþOrpëääIdentityÁå_pÁ)±ºëì,Z¢¿c¾Ú88ï:žºTþOrpë¤;8 8 8#8س¿cÚ@ä è
Ùè19(¹ 8è½¾=4¾? ¾Iè ècmî³Ñ ü¡0ü¢cý‚Bõ;SGCõsìš!T¬!赪 ò¥è ¶!üö L 8òòStackÁõinnerÁöouterÁ&e4AàÒè Á!È!ü­ ›ýë["Òèâ88ï:žºTþOrpëüÜÐ ¾Òü0è0$ž($ü*è̇+ êž òêêLayerFnÁì±ï<V°jŸ®ÿ´è­ 8òòõö¤&e4AàÖèœ  +§+üýÇ<´ ÀèÖü+ Í"Öè¬88ï:žºTþOrpë§ü¿*2¾$°*´ ¶*Ö§è¥,±0žçT܉èì‰üµ‰7è Љ¾$lj /T§Œ ȩ̀Œ
Ýè¤<<¸Œt²Œ ¿ŒÆŒüÇ‹èùÜTï‹É,Ù‹ù<à‹Ú¥Ø Wð²$¤ ® üÖŸX¾$òŸ¾$éŸ /$°©º©ü¼¨~¾$㨾$Ú¨ /$±¸»¸üœ·Ÿ¾$Æ·¾$½· 0üƒ×
ç
…d ƒ×þ „‘×ì…×L\©× è ¿cüƒ×2h
ð`«W”£× ´× üƒ×;©
÷`]D¶× Ã×Ä×"üÀÖÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ŸÈŸÈ ÈErrorÁ O˜éBL\íÖÉ,ÇÖ  c cˆ¢cµ
 `£cbufÁ `àB¤GS
 ÎÖ ã`ã`
DebugTupleÁæ`×µ`ç` µ`è`˵`é`
empty_nameÁµ`ø/wŒ4@<)Ú¶&q¸&yº#(Ú0籫×"´Úº#cØ#3™$øTäØ ¼äØÈ 
Ý9,õØdïØ úØÙ'ü¯ØRÜlÌØ ç,¸Ø,¿Ø ¨ #]¸(µ  (47ÀïtÊG81LayerÁ,øHÚ2ô<¥IÙJüÌ2/ `async fn(Request) -> Result<Response, Error>`Áÿú # OverviewÁúü–FC Tower is a library of modular and reusable components for buildingÁüÝ*' robust networking clients and servers.ÁˆúüŒJG Tower provides a simple core abstraction, the [`Service`] trait, whichÁü×OL represents an asynchronous function taking a request and returning either aÁü§PM response or an error. This abstraction can be used to model both clients andÁ servers.Áúü‰OL Generic components, like [timeouts], [rate limiting], and [load balancing],ÁüÙIF can be modeled as [`Service`]s that wrap some inner service and applyÁü£PM additional behavior before or after the inner service is called. This allowsÁüôTQ implementing these components in a protocol-agnostic, composable way. Typically,ÁüÉ2/ such services are referred to as _middleware_.Áüúü€ FC An additional abstraction, the [`Layer`] trait, is used to composeÁüÇ JG middleware with [`Service`]s. If a [`Service`] can be thought of as anÁü’
PM asynchronous function from a request type to a response type, a [`Layer`] isÁüã
PM a function taking a [`Service`] of one type and returning a [`Service`] of aÁü´ NK different type. The [`ServiceBuilder`] type is used to add middleware to aÁüƒ 52 service by composing it with multiple [`Layer`]s.Á¹ úÔ½  ## The Tower EcosystemÁØ úüÜ -* Tower is made up of the following crates:ÁŠ
úäŽ
 * [`tower`] (this crate)Á¼«
 * [`tower-service`]Á¬Ã
 * [`tower-layer`]Á¤Ù
 * [`tower-test`]Áî
úüò
OL Since the [`Service`] and [`Layer`] traits are important integration pointsÁüÂKH for all libraries using Tower, they are kept as stable as possible, andÁüŽMJ breaking changes are made rarely. Therefore, they are defined in separateÁüÜFC crates, [`tower-service`] and [`tower-layer`]. This crate containsÁü£EB re-exports of those core traits, implementations of commonly-usedÁüéMJ middleware, and [utilities] for working with [`Service`]s and [`Layer`]s.Áü·OL Finally, the [`tower-test`] crate provides tools for testing programs usingÁT‡ Tower.Áú\ # UsageÁ¢úü¦OL Tower provides an abstraction layer, and generic implementations of variousÁüöOL middleware. This means that the `tower` crate on its own does *not* provideÁüÆLI a working implementation of a network client or server. Instead, Tower'sÁü“FC [`Service` trait][`Service`] provides an integration point betweenÁüÚIF application code, libraries providing middleware implementations, andÁü¤GD libraries that implement servers and/or clients for various networkÁ protocols.ÁûúüÿOL Depending on your particular use case, you might use Tower in several ways:ÁÏúüÓKH * **Implementing application logic** for a networked program. You mightÁüŸMJ use the [`Service`] trait to model your application's behavior, and useÁüíNK the middleware [provided by this crate](#modules) and by other librariesÁü¼IF to add functionality to clients and servers provided by one or moreÁü† protocol implementations.Áü¦OL * **Implementing middleware** to add custom behavior to network clients andÁüöLI servers in a reusable manner. This might be general-purpose middlewareÁüÃOL (and if it is, please consider releasing your middleware as a library forÁü“KH other Tower users!) or application-specific behavior that needs to beÁüß1. shared between multiple clients or servers.Áü‘KH * **Implementing a network protocol**. Libraries that implement networkÁüÝGD protocols (such as HTTP) can depend on `tower-service` to use theÁü¥MJ [`Service`] trait as an integration point between the protocol and userÁüóPM code. For example, a client for some protocol might implement [`Service`],ÁüÄHE allowing users to add arbitrary Tower middleware to those clients.ÁüLI Similarly, a server might be created from a user-provided [`Service`].ÁÚúüÞJG Additionally, when a network protocol requires functionality alreadyÁü© PM provided by existing Tower middleware, a protocol implementation might useÁüú FC Tower middleware internally, as well as as an integration point.ÁÁ!ú´Å! ## Library SupportÁÜ!úüà!NK A number of third-party libraries support Tower and the [`Service`] trait.Áü¯":7 The following is an incomplete list of such libraries:Áê"úüî"B? * [`hyper`]: A fast and correct low-level HTTP implementation.Áü±#JG * [`tonic`]: A [gRPC-over-HTTP/2][grpc] implementation built on top ofÁüü#PM [`hyper`]. See [here][tonic-examples] for examples of using [`tonic`] withÁdÍ$ Tower.ÁüÚ$<9 * [`warp`]: A lightweight, composable web framework. SeeÁü—%DA [here][warp-service] for details on using [`warp`] with Tower.ÁüÜ%OL * [`tower-lsp`] and its fork, [`lspower`]: implementations of the [La
\6Z\LN>@´a3D~'üñ)õ ´ ¤¡õ 
ìÕõ¤¢üù$! Create a new [`ServiceBuilder`].Á©õ

̉Íìè Ž¾ü­ >ü©41 Add a new layer `T` into the [`ServiceBuilder`].ÁâúüêLI This wraps the inner service with the service provided by a user-definedÁü»EB [`Layer`]. The provided layer must implement the [`Layer`] trait.ÁúÜ µe,´ ¾ÒŠ¥ÍìÒ º 
èÒ@ žI ü*Tü½(]Z Add a [`Layer`] built from a function that accepts a service and returns another service.ÁŸ)úü§)<9 See the documentation for [`layer_fn`] for more details.Áè)úüð)(% [`layer_fn`]: crate::layer::layer_fnÁD¤*¾´ÖÍì´ ­*
è´
±䵉üþˆ2/ Returns the underlying `Layer` implementation.ÁT¼‰¾è
è¡üÇ‹Qüò‰=: Wrap the service `S` with the middleware provided by thisÁü´ŠB? [`ServiceBuilder`]'s [`Layer`]'s, returning a new [`Service`].ÁûŠú܃‹µeü£‹e<΋> ùÀ¤ Ù‹Íìù Ö‹ÚèùDŒ
èù$Ú‹Øa13üÖŸ?ü€™.+ Check that the builder implements `Clone`.Á³™úü»™[X This can be useful when debugging type errors in `ServiceBuilder`s with lots of layers.Á›šúü£šC@ Doesn't actually change the builder but serves as a type check.Áëšúlóš
# ExampleÁ…›ú\ ```rustÁô use tower::ServiceBuilder;ÁÀ›úüÈ›'$ let builder = ServiceBuilder::new()Áüô›52 // Do something before processing the requestÁü®œ(% .map_request(|request: String| {ÁüÛœ%" println!("got request!");Áœ… requestÁT })Áü¬41 // Ensure our `ServiceBuilder` can be clonedÁ´å .check_clone()Áü€ž41 // Do something after processing the requestÁü¹ž*' .map_response(|response: String| {Áüèž&# println!("got response!");Á¤“Ÿ responseÁ\¬Ÿ });Á<¼Ÿ˜_\ÝŸ¾¾Ø¾, 
èØü¼¨eü´ ^[ Check that the builder when given a service of type `S` produces a service that implementsÁd—¡ `Clone`.Á¨¡úü°¡[¯y¢úü˜¢C¢zà¢úlè¢üzú¢ú\‚£ {ô’£µ{µ£ú´½£ # #[derive(Clone)]Á¼Ø£ # struct MyService;Á,ô£üþ£'ë{üª¤5|üä¤(Ý|ü‘¥%}œ»¥¿}TÓ¥Ü}üâ¥OL // Ensure that the service produced when given a `MyService` implementsÁü¶¦+( .check_service_clone::<MyService>()Áüæ¦4Ð~üŸ§*üΧ&Ĥù§ô\’¨’€<¢¨˜_œÃ¨¾¾¤Žy רŸyDý¨ØÀ,›©
èù6-/üœ·üÀ©]Z Check that the builder when given a service of type `S` produces a service with the givenÁü¢ª'$ request, response, and error types.ÁΪúüÖª[¯y¶«úü¾«C¢z†¬úlެüz ¬ú\¨¬ {ô¸¬µ{üÛ¬# use std::task::{Poll, Context};Áüƒ­%" use tower::{Service, ServiceExt};Á­­ú̵­ // An example serviceÁ¬Ó­ struct MyService;Áí­úüõ­)& impl Service<Request> for MyService {Áü£® type Response = Response;ÁÌÇ® type Error = Error;Áüå®IF type Future = futures_util::future::Ready<Result<Response, Error>>;Á³¯úü»¯WT fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {Á„—°
// ...Áœ¬° # todo!()Á<İаúüذ<9 fn call(&mut self, request: Request) -> Self::Future {Á„™±œ®±·<ƱÔ,Ò±ܱúœä± struct Request;Á¤ü± struct Response;ÁŒ•² struct Error;Á«²úü³²%" struct WrappedResponse(Response);Áݲúüå²'ë{ü‘³YV // At this point in the builder if given a `MyService` it produces a service thatÁüï³LI // accepts `Request`s, produces `Response`s, and fails with `Error`sÁüÀ´?< .check_service::<MyService, Request, Response, Error>()Áü„µ.+ // Wrap responses in `WrappedResponse`Áü·µEB .map_response(|response: Response| WrappedResponse(response))Áü:7 // Now the response type will be `WrappedResponse`ÁüÀ¶=: .check_service::<MyService, _, WrappedResponse, _>();Á<‚·˜_l£·¾¾¤¥¦Žy ±·Íì¥ ´·Íì¦ ··Íì º·ŸyDà·À–üþ·#À– Ö–d‰¸À–
ê–L—¸
èù–Ö–ê–¥§ž ü…Ö4!!âo ŠÖ¿cèTÖ¾"Àc"!#üÀÖ8ÃÖ?@A  @ c cˆ¢cµ
 `£cŽ% `àB¤GS
AÝ$  ÇÖ
"è$ÈÖ±¯üÈ×@¤$%%$Íì Í×Íì Ð×ÚDÿ×ç&'ÜÝ';=79dØ<”Ø##…)ü¯Ø*,²ØB çÜ# ¸Ø#
'$¹Ø)lŒFü2/ A collection of [`Layer`] based tower servicesÁ3úÜ7µe,”F-±Dj *¦),tÚ+à<{ê,\\/1$&ü†" Utilities for combining layersÁ©úü­.+ [`Identity`]: crate::layer::util::IdentityÁÜܵeüø(% [`Stack`]: crate::layer::util::StackÁ©ä/ò0\¼#%ôºG˜”ëH­´–I¾TÉI4ÍI5œÚI4äI5¥656Îì´ÚIÚr ëI5ìŸìŸ$ "ŒœJüôI'$ Alias for a type-erased error type.ÁD¥JžBoxÁ¡ˆˆ¢ˆl }.xϾ ÌìçEçEèEGlobalÁ ¿±‡§í#äÁü‰/, Declaratively construct [`Service`] values.Á¹úü½QN [`ServiceBuilder`] provides a [builder-like interface][builder] for composingÁü*' layers to be applied to a [`Service`].Áºú
# ServiceÁÌúüÐOL A [`Service`] is a trait representing an asynchronous function of a requestÁü SP to a response. It is similar to `async fn(Request) -> Result<Response, Error>`.ÁôúüøIF A [`Service`] is typically bound to a single transport, such as a TCPÁüÂNK connection. It defines how _all_ inbound or outbound requests are handledÁ¼‘ by that connection.Á©úü­LI [builder]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.htmlÁúú # OrderÁŠúüŽPM The order in which layers are added impacts how requests are handled. LayersÁüßOL that are added first will be called with the request first. The argument toÁü¯.+ `service` will be last to see the request.ÁÞú˜_üêHE # // this (and other) doctest is ignored because we don't have a wayÁü³DA # // to say that it should only be run with cfg(feature = "...")ÁÌø # use tower::Service;Áü’ )& # use tower::builder::ServiceBuilder;Áü¼ 85 # #[cfg(all(feature = "buffer", feature = "limit"))]Áüõ mj # async fn wrap<S>(svc: S) where S: Service<(), Error = &'static str> + 'static + Send, S::Future: Send {ÁÌã
 ServiceBuilder::new()Á¤ý
 .buffer(100)Áô’  .concurrency_limit(10)Á¬±  .service(svc)Á  # ;Á  # }Á<× ˜_ß úüã NK In the above example, the buffer layer receives the request first followedÁü² NK by `concurrency_limit`. `buffer` enables up to 100 request to be in-flightÁü
KH **on top of** the requests that have already been forwarded to the nextÁüÍ
RO layer. Combined with `concurrency_limit`, this allows up to 110 requests to beÁt  in-flight.Á¯ú˜_Ì»¾ªüÕ)áªüÿ8”«ü¸mÖ«̦̬ôÀ‹­¤ßô²­Э<à­˜_¢úü¦KH The above example is similar, but the order of layers is reversed. Now,ÁüòQN `concurrency_limit` applies first and only allows 10 requests to be in-flightÁ total.ÁÏú # ExamplesÁâúüæ,) A [`Service`] stack with a single layer:Áú<—˜_ÌŸ¾ªü¹)áªüã # #[cfg(feature = "limit")]Áüƒ;8 # use tower::limit::concurrency::ConcurrencyLimitLayer;Áü¿‘µüßmÖ«ÌÍ̬ìç .concurrency_limit(5)Á´… .service(svc);ÁЭà­˜_´úü¸JG A [`Service`] stack with _multiple_ layers that contain rate limiting,ÁüƒIF in-flight request limits, and a channel-backed, clonable [`Service`]:ÁÍú˜_ÌÙ¾ªüó)áªô # use std::time::Duration;Áü¼8”«üõmÖ«Ìã̬”ý .buffer(5)Áì§¶ü®.+ .rate_limit(5, Duration::from_secs(1))Á´ÝͶЭà­<„˜_Œúüe99âo Û¾ºTþOrpë:88è

<<âocØèÛ¾=Ù=ƒ

C ¾;¹;
=è