Debian Codegraph @

src/sources/mod.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{
2 cellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/::{Refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/Ref#, RefCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefCell#, RefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefMut#},
3 opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{BitOrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOr#, BitOrAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOrAssign#},
4 rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/::Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#,
5 };
6
7 use craterust-analyzer cargo calloop 0.10.5 crate/::{sysrust-analyzer cargo calloop 0.10.5 sys/::TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#, Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, Readinessrust-analyzer cargo calloop 0.10.5 sys/Readiness#, Tokenrust-analyzer cargo calloop 0.10.5 sys/Token#};
8
9 pub mod channelrust-analyzer cargo calloop 0.10.5 sources/channel/;
10 #[cfg(feature = "executor")]
11 #[cfg_attr(docsrs, doc(cfg(feature = "executor")))]
12 pub mod futuresrust-analyzer cargo calloop 0.10.5 sources/futures/;
13 pub mod genericrust-analyzer cargo calloop 0.10.5 sources/generic/;
14 pub mod pingrust-analyzer cargo calloop 0.10.5 sources/ping/;
15 #[cfg(target_os = "linux")]
16 #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
17 pub mod signalsrust-analyzer cargo calloop 0.10.5 sources/signals/;
18 pub mod timerrust-analyzer cargo calloop 0.10.5 sources/timer/;
19 pub mod transientrust-analyzer cargo calloop 0.10.5 sources/transient/;
20
21 /// Possible actions that can be requested to the event loop by an
22 /// event source once its events have been processed.
23 ///
24 /// `PostAction` values can be combined with the `|` (bit-or) operator (or with
25 /// `|=`) with the result that:
26 /// - if both values are identical, the result is that value
27 /// - if they are different, the result is [`Reregister`](PostAction::Reregister)
28 ///
29 /// Bit-or-ing these results is useful for composed sources to combine the
30 /// results of their child sources, but note that it only applies to the child
31 /// sources. For example, if every child source returns `Continue`, the result
32 /// will be `Continue`, but the parent source might still need to return
33 /// `Reregister` or something else depending on any additional logic it uses.
34 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)]
35 pub enum PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction# {
36 /// Continue listening for events on this source as before
37 Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#,
38 /// Trigger a re-registration of this source
39 Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#,
40 /// Disable this source
41 ///
42 /// Has the same effect as [`LoopHandle::disable`](crate::LoopHandle#method.disable)
43 Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#,
44 /// Remove this source from the eventloop
45 ///
46 /// Has the same effect as [`LoopHandle::kill`](crate::LoopHandle#method.kill)
47 Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#,
48 }
49
50 /// Combines `PostAction` values returned from nested event sources.
51 impl BitOrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOr# for PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction# {
52 type Outputrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]Output# = Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`];
53
54 fn bitorrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor().(self, rhs: Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOr#Output# {
55 if matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self, x if x == rhs) {
56 self
57 } else {
58 Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]::Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#
59 }
60 }
61 }
62
63 /// Combines `PostAction` values returned from nested event sources.
64 impl BitOrAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOrAssign# for PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction# {
65 fn bitor_assignrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().(&mut self, rhs: Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]) {
66 if *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().rhs {
67 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]::Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
68 }
69 }
70 }
71
72 /// Trait representing an event source
73 ///
74 /// This is the trait you need to implement if you wish to create your own
75 /// calloop-compatible event sources.
76 ///
77 /// The 3 associated types define the type of closure the user will need to
78 /// provide to process events for your event source.
79 ///
80 /// The `process_events` method will be called when one of the FD you registered
81 /// is ready, with the associated readiness and token.
82 ///
83 /// The `register`, `reregister` and `unregister` methods are plumbing to let your
84 /// source register itself with the polling system. See their documentation for details.
85 ///
86 /// In case your event source needs to do some special processing before or after a
87 /// polling session occurs (to prepare the underlying source for polling, and cleanup
88 /// after that), you can override the `pre_run` and `post_run`, that do nothing by
89 /// default. Depending on the underlying events, `process_events` may be invoked once,
90 /// several times, or none at all between `pre_run` and `post_run` are called, but when
91 /// it is invoked, it'll always be between those two.
92 pub trait EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource# {
93 /// The type of events generated by your source.
94 type Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#;
95 /// Some metadata of your event source
96 ///
97 /// This is typically useful if your source contains some internal state that
98 /// the user may need to interact with when processing events. The user callback
99 /// will receive a `&mut Metadata` reference.
100 ///
101 /// Set to `()` if not needed.
102 type Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#;
103 /// The return type of the user callback
104 ///
105 /// If the user needs to return some value back to your event source once its
106 /// processing is finshed (to indicate success or failure for example), you can
107 /// specify it using this type.
108 ///
109 /// Set to `()` if not needed.
110 type Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#;
111 /// The error type returned from
112 /// [`process_events()`](Self::process_events()) (not the user callback!).
113 type Errorrust-analyzer cargo calloop 0.10.5 sources/EventSource#Error#: Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>>;
114
115 /// Process any relevant events
116 ///
117 /// This method will be called every time one of the FD you registered becomes
118 /// ready, including the readiness details and the associated token.
119 ///
120 /// Your event source will then do some processing of the file descriptor(s) to generate
121 /// events, and call the provided `callback` for each one of them.
122 ///
123 /// You should ensure you drained the file descriptors of their events, especially if using
124 /// edge-triggered mode.
125 fn process_eventsrust-analyzer cargo calloop 0.10.5 sources/EventSource#process_events().<F>(
126 &mut self,
127 readiness: Readinessrust-analyzer cargo calloop 0.10.5 sys/Readiness#,
128 token: Tokenrust-analyzer cargo calloop 0.10.5 sys/Token#,
129 callback: F,
130 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#, Self::Errorrust-analyzer cargo calloop 0.10.5 sources/EventSource#Error#>
131 where
132 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Self::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Self::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Self::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#;
133
134 /// Register yourself to this poll instance
135 ///
136 /// You should register all your relevant file descriptors to the provided [`Poll`](crate::Poll)
137 /// using its [`Poll::register`](crate::Poll#method.register) method.
138 ///
139 /// If you need to register more than one file descriptor, you can change the
140 /// `sub_id` field of the [`Token`](crate::Token) to differentiate between them.
141 fn registerrust-analyzer cargo calloop 0.10.5 sources/EventSource#register().(&mut self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>;
142
143 /// Re-register your file descriptors
144 ///
145 /// Your should update the registration of all your relevant file descriptor to
146 /// the provided [`Poll`](crate::Poll) using its [`Poll::reregister`](crate::Poll#method.reregister),
147 /// if necessary.
148 fn reregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#reregister().(
149 &mut self,
150 poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#,
151 token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#,
152 ) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>;
153
154 /// Unregister your file descriptors
155 ///
156 /// You should unregister all your file descriptors from this [`Poll`](crate::Poll) using its
157 /// [`Poll::unregister`](crate::Poll#method.unregister) method.
158 fn unregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#unregister().(&mut self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>;
159
160 /// Notification that a polling session is going to start
161 ///
162 /// You can generate events from this method as you would from `process_events`.
163 fn pre_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#pre_run().<F>(&mut self, _callback: F) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>
164 where
165 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Self::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Self::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Self::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
166 {
167 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
168 }
169
170 /// Notification that the current polling session ended
171 ///
172 /// You can generate events from this method as you would from `process_events`.
173 fn post_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#post_run().<F>(&mut self, _callback: F) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>
174 where
175 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Self::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Self::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Self::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
176 {
177 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
178 }
179 }
180
181 /// Blanket implementation for boxed event sources. [`EventSource`] is not an
182 /// object safe trait, so this does not include trait objects.
183 impl<T: EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource#> EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource# for Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<T> {
184 type Eventrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]Event# = T::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#;
185 type Metadatarust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]Metadata# = T::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#;
186 type Retrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]Ret# = T::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#;
187 type Errorrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]Error# = T::Errorrust-analyzer cargo calloop 0.10.5 sources/EventSource#Error#;
188
189 fn process_eventsrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]process_events().<F>(
190 &mut self,
191 readiness: Readinessrust-analyzer cargo calloop 0.10.5 sys/Readiness#,
192 token: Tokenrust-analyzer cargo calloop 0.10.5 sys/Token#,
193 callback: F,
194 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#, Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Errorrust-analyzer cargo calloop 0.10.5 sources/EventSource#Error#>
195 where
196 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
197 {
198 T::process_eventsrust-analyzer cargo calloop 0.10.5 sources/EventSource#process_events().(&mut *rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, readiness, token, callback)
199 }
200
201 fn registerrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]register().(&mut self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
202 T::registerrust-analyzer cargo calloop 0.10.5 sources/EventSource#register().(&mut *rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, poll, token_factory)
203 }
204
205 fn reregisterrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]reregister().(
206 &mut self,
207 poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#,
208 token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#,
209 ) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
210 T::reregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#reregister().(&mut *rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, poll, token_factory)
211 }
212
213 fn unregisterrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]unregister().(&mut self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
214 T::unregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#unregister().(&mut *rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, poll)
215 }
216
217 fn pre_runrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]pre_run().<F>(&mut self, callback: F) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>
218 where
219 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
220 {
221 T::pre_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#pre_run().(&mut *rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, callback)
222 }
223
224 fn post_runrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]post_run().<F>(&mut self, callback: F) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>
225 where
226 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Box<T>`][EventSource]::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
227 {
228 T::post_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#post_run().(&mut *rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T, A>`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, callback)
229 }
230 }
231
232 /// Blanket implementation for exclusive references to event sources.
233 /// [`EventSource`] is not an object safe trait, so this does not include trait
234 /// objects.
235 impl<T: EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource#> EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource# for &mut T {
236 type Eventrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]Event# = T::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#;
237 type Metadatarust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]Metadata# = T::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#;
238 type Retrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]Ret# = T::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#;
239 type Errorrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]Error# = T::Errorrust-analyzer cargo calloop 0.10.5 sources/EventSource#Error#;
240
241 fn process_eventsrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]process_events().<F>(
242 &mut self,
243 readiness: Readinessrust-analyzer cargo calloop 0.10.5 sys/Readiness#,
244 token: Tokenrust-analyzer cargo calloop 0.10.5 sys/Token#,
245 callback: F,
246 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#, Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Errorrust-analyzer cargo calloop 0.10.5 sources/EventSource#Error#>
247 where
248 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
249 {
250 T::process_eventsrust-analyzer cargo calloop 0.10.5 sources/EventSource#process_events().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, readiness, token, callback)
251 }
252
253 fn registerrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]register().(&mut self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
254 T::registerrust-analyzer cargo calloop 0.10.5 sources/EventSource#register().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, poll, token_factory)
255 }
256
257 fn reregisterrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]reregister().(
258 &mut self,
259 poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#,
260 token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#,
261 ) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
262 T::reregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#reregister().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, poll, token_factory)
263 }
264
265 fn unregisterrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]unregister().(&mut self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
266 T::unregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#unregister().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, poll)
267 }
268
269 fn pre_runrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]pre_run().<F>(&mut self, callback: F) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>
270 where
271 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
272 {
273 T::pre_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#pre_run().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, callback)
274 }
275
276 fn post_runrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]post_run().<F>(&mut self, callback: F) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>
277 where
278 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`&mut T`][EventSource]::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
279 {
280 T::post_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#post_run().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self, callback)
281 }
282 }
283
284 pub(craterust-analyzer cargo calloop 0.10.5 crate/) struct DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#<S, F> {
285 sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.: S,
286 callbackrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#callback.: F,
287 }
288
289 impl<Data, S, F> EventDispatcherrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#<Data> for RefCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefCell#<DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#<S, F>>
290 where
291 S: EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource#,
292 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(S::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut S::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#, &mut Data) -> S::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret#,
293 {
294 fn process_eventsrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`EventDispatcher<Data>`]process_events().(
295 &self,
296 readiness: Readinessrust-analyzer cargo calloop 0.10.5 sys/Readiness#,
297 token: Tokenrust-analyzer cargo calloop 0.10.5 sys/Token#,
298 data: &mut Data,
299 ) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#> {
300 let mut disp = self.borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow_mut().();
301 let DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner# {
302 ref mut sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.,
303 ref mut callbackrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#callback.,
304 } = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefMut<'_, T>`][DerefMut]deref_mut().disp;
305 source
306 .process_eventsrust-analyzer cargo calloop 0.10.5 sources/EventSource#process_events().(readiness, token, |event, meta| callback(event, meta, data))
307 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| craterust-analyzer cargo calloop 0.10.5 crate/::Errorrust-analyzer cargo calloop 0.10.5 error/Error#::OtherErrorrust-analyzer cargo calloop 0.10.5 error/Error#OtherError#(e.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#into().()))
308 }
309
310 fn registerrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`EventDispatcher<Data>`]register().(&self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
311 self.borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow_mut().().sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source..registerrust-analyzer cargo calloop 0.10.5 sources/EventSource#register().(poll, token_factory)
312 }
313
314 fn reregisterrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`EventDispatcher<Data>`]reregister().(&self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<bool> {
315 if let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(mut me) = self.try_borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]try_borrow_mut().() {
316 me.sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source..reregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#reregister().(poll, token_factory)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
317 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(true)
318 } else {
319 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(false)
320 }
321 }
322
323 fn unregisterrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`EventDispatcher<Data>`]unregister().(&self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<bool> {
324 if let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(mut me) = self.try_borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]try_borrow_mut().() {
325 me.sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source..unregisterrust-analyzer cargo calloop 0.10.5 sources/EventSource#unregister().(poll)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
326 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(true)
327 } else {
328 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(false)
329 }
330 }
331
332 fn pre_runrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`EventDispatcher<Data>`]pre_run().(&self, data: &mut Data) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
333 let mut disp = self.borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow_mut().();
334 let DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner# {
335 ref mut sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.,
336 ref mut callbackrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#callback.,
337 } = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefMut<'_, T>`][DerefMut]deref_mut().disp;
338 source.pre_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#pre_run().(|event, meta| callback(event, meta, data))
339 }
340
341 fn post_runrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`EventDispatcher<Data>`]post_run().(&self, data: &mut Data) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()> {
342 let mut disp = self.borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow_mut().();
343 let DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner# {
344 ref mut sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.,
345 ref mut callbackrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#callback.,
346 } = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefMut<'_, T>`][DerefMut]deref_mut().disp;
347 source.post_runrust-analyzer cargo calloop 0.10.5 sources/EventSource#post_run().(|event, meta| callback(event, meta, data))
348 }
349 }
350
351 pub(craterust-analyzer cargo calloop 0.10.5 crate/) trait EventDispatcherrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#<Data> {
352 fn process_eventsrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#process_events().(
353 &self,
354 readiness: Readinessrust-analyzer cargo calloop 0.10.5 sys/Readiness#,
355 token: Tokenrust-analyzer cargo calloop 0.10.5 sys/Token#,
356 data: &mut Data,
357 ) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#>;
358
359 fn registerrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#register().(&self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>;
360
361 fn reregisterrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#reregister().(&self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#, token_factory: &mut TokenFactoryrust-analyzer cargo calloop 0.10.5 sys/TokenFactory#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<bool>;
362
363 fn unregisterrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#unregister().(&self, poll: &mut Pollrust-analyzer cargo calloop 0.10.5 sys/Poll#) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<bool>;
364
365 fn pre_runrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#pre_run().(&self, data: &mut Data) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>;
366
367 fn post_runrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#post_run().(&self, data: &mut Data) -> craterust-analyzer cargo calloop 0.10.5 crate/::Resultrust-analyzer cargo calloop 0.10.5 error/Result#<()>;
368 }
369
370 // An internal trait to erase the `F` type parameter of `DispatcherInner`
371 trait ErasedDispatcherrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#<'a, S, Data> {
372 fn as_source_refrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#as_source_ref().(&self) -> Refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/Ref#<S>;
373 fn as_source_mutrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#as_source_mut().(&self) -> RefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefMut#<S>;
374 fn into_source_innerrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#into_source_inner().(self: Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Self>) -> S;
375 fn into_event_dispatcherrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#into_event_dispatcher().(self: Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Self>) -> Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<dyn EventDispatcherrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#<Data> + 'a>;
376 }
377
378 impl<'a, S, Data, F> ErasedDispatcherrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#<'a, S, Data> for RefCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefCell#<DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#<S, F>>
379 where
380 S: EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource# + 'a,
381 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(S::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut S::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#, &mut Data) -> S::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret# + 'a,
382 {
383 fn as_source_refrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`ErasedDispatcher<'a, S, Data>`]as_source_ref().(&self) -> Refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/Ref#<S> {
384 Refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/Ref#::maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`Ref<'b, T>`]map().(self.borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow().(), |inner| &inner.sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.)
385 }
386
387 fn as_source_mutrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`ErasedDispatcher<'a, S, Data>`]as_source_mut().(&self) -> RefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefMut#<S> {
388 RefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefMut#::maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefMut<'b, T>`]map().(self.borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow_mut().(), |inner| &mut inner.sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.)
389 }
390
391 fn into_source_innerrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`ErasedDispatcher<'a, S, Data>`]into_source_inner().(self: Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`ErasedDispatcher<'a, S, Data>`]>) -> S {
392 if let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ref_cell) = Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::try_unwraprust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T, A>`]try_unwrap().(self) {
393 ref_cell.into_innerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]into_inner().().sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source.
394 } else {
395 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("Dispatcher is still registered");
396 }
397 }
398
399 fn into_event_dispatcherrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`ErasedDispatcher<'a, S, Data>`]into_event_dispatcher().(self: Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`RefCell<DispatcherInner<S, F>>`][`ErasedDispatcher<'a, S, Data>`]>) -> Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<dyn EventDispatcherrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#<Data> + 'a>
400 where
401 S: 'a,
402 {
403 self as Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<dyn EventDispatcherrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#<Data> + 'a>
404 }
405 }
406
407 /// An event source with its callback.
408 ///
409 /// The `Dispatcher` can be registered in an event loop.
410 /// Use the `as_source_{ref,mut}` functions to interact with the event source.
411 /// Use `into_source_inner` to get the event source back.
412 pub struct Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#<'a, S, Data>(Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<dyn ErasedDispatcherrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#<'a, S, Data> + 'a>);
413
414 impl<'a, S, Data> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#<'a, S, Data> {
415 #[cfg_attr(coverage, no_coverage)]
416 fn fmtrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`][Debug]fmt().(&self, f: &mut stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
417 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Dispatcher { ... }")
418 }
419 }
420
421 impl<'a, S, Data> Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#<'a, S, Data>
422 where
423 S: EventSourcerust-analyzer cargo calloop 0.10.5 sources/EventSource# + 'a,
424 {
425 /// Builds a dispatcher.
426 ///
427 /// The resulting `Dispatcher`
428 pub fn newrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`]new().<F>(source: S, callback: F) -> Selfrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`]
429 where
430 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(S::Eventrust-analyzer cargo calloop 0.10.5 sources/EventSource#Event#, &mut S::Metadatarust-analyzer cargo calloop 0.10.5 sources/EventSource#Metadata#, &mut Data) -> S::Retrust-analyzer cargo calloop 0.10.5 sources/EventSource#Ret# + 'a,
431 {
432 Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#(Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T>`]new().(RefCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefCell#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]new().(DispatcherInnerrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner# { sourcerust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#source., callbackrust-analyzer cargo calloop 0.10.5 sources/DispatcherInner#callback. })))
433 }
434
435 /// Returns an immutable reference to the event source.
436 ///
437 /// # Panics
438 ///
439 /// Has the same semantics as `RefCell::borrow()`.
440 ///
441 /// The dispatcher being mutably borrowed while its events are dispatched,
442 /// this method will panic if invoked from within the associated dispatching closure.
443 pub fn as_source_refrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`]as_source_ref().(&self) -> Refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/Ref#<S> {
444 self.0rust-analyzer cargo calloop 0.10.5 sources/Dispatcher#0..as_source_refrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#as_source_ref().()
445 }
446
447 /// Returns a mutable reference to the event source.
448 ///
449 /// # Panics
450 ///
451 /// Has the same semantics as `RefCell::borrow_mut()`.
452 ///
453 /// The dispatcher being mutably borrowed while its events are dispatched,
454 /// this method will panic if invoked from within the associated dispatching closure.
455 pub fn as_source_mutrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`]as_source_mut().(&self) -> RefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefMut#<S> {
456 self.0rust-analyzer cargo calloop 0.10.5 sources/Dispatcher#0..as_source_mutrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#as_source_mut().()
457 }
458
459 /// Consumes the Dispatcher and returns the inner event source.
460 ///
461 /// # Panics
462 ///
463 /// Panics if the `Dispatcher` is still registered.
464 pub fn into_source_innerrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`]into_source_inner().(self) -> S {
465 self.0rust-analyzer cargo calloop 0.10.5 sources/Dispatcher#0..into_source_innerrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#into_source_inner().()
466 }
467
468 pub(craterust-analyzer cargo calloop 0.10.5 crate/) fn clone_as_event_dispatcherrust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`]clone_as_event_dispatcher().(&self) -> Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<dyn EventDispatcherrust-analyzer cargo calloop 0.10.5 sources/EventDispatcher#<Data> + 'a> {
469 Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T, A>`][Clone]clone().(&self.0rust-analyzer cargo calloop 0.10.5 sources/Dispatcher#0.).into_event_dispatcherrust-analyzer cargo calloop 0.10.5 sources/ErasedDispatcher#into_event_dispatcher().()
470 }
471 }
472
473 impl<'a, S, Data> Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# for Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#<'a, S, Data> {
474 fn clonerust-analyzer cargo calloop 0.10.5 sources/impl#[`Dispatcher<'a, S, Data>`][Clone]clone().(&self) -> Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#<'a, S, Data> {
475 Dispatcherrust-analyzer cargo calloop 0.10.5 sources/Dispatcher#(Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#::clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/impl#[`Rc<T, A>`][Clone]clone().(&self.0rust-analyzer cargo calloop 0.10.5 sources/Dispatcher#0.))
476 }
477 }
478
479 /// An idle callback that was inserted in this loop
480 ///
481 /// This handle allows you to cancel the callback. Dropping
482 /// it will *not* cancel it.
483 pub struct Idlerust-analyzer cargo calloop 0.10.5 sources/Idle#<'i> {
484 pub(craterust-analyzer cargo calloop 0.10.5 crate/) callbackrust-analyzer cargo calloop 0.10.5 sources/Idle#callback.: Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<RefCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/RefCell#<dyn CancellableIdlerust-analyzer cargo calloop 0.10.5 sources/CancellableIdle# + 'i>>,
485 }
486
487 impl<'i> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Idlerust-analyzer cargo calloop 0.10.5 sources/Idle#<'i> {
488 #[cfg_attr(coverage, no_coverage)]
489 fn fmtrust-analyzer cargo calloop 0.10.5 sources/impl#[`Idle<'i>`][Debug]fmt().(&self, f: &mut stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
490 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Idle { ... }")
491 }
492 }
493
494 impl<'i> Idlerust-analyzer cargo calloop 0.10.5 sources/Idle#<'i> {
495 /// Cancel the idle callback if it was not already run
496 pub fn cancelrust-analyzer cargo calloop 0.10.5 sources/impl#[`Idle<'i>`]cancel().(self) {
497 self.callbackrust-analyzer cargo calloop 0.10.5 sources/Idle#callback..borrow_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/impl#[`RefCell<T>`]borrow_mut().().cancelrust-analyzer cargo calloop 0.10.5 sources/CancellableIdle#cancel().();
498 }
499 }
500
501 pub(craterust-analyzer cargo calloop 0.10.5 crate/) trait CancellableIdlerust-analyzer cargo calloop 0.10.5 sources/CancellableIdle# {
502 fn cancelrust-analyzer cargo calloop 0.10.5 sources/CancellableIdle#cancel().(&mut self);
503 }
504
505 impl<F> CancellableIdlerust-analyzer cargo calloop 0.10.5 sources/CancellableIdle# for Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<F> {
506 fn cancelrust-analyzer cargo calloop 0.10.5 sources/impl#[`Option<F>`][CancellableIdle]cancel().(&mut self) {
507 self.takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]take().();
508 }
509 }
510
511 pub(craterust-analyzer cargo calloop 0.10.5 crate/) trait IdleDispatcherrust-analyzer cargo calloop 0.10.5 sources/IdleDispatcher#<Data> {
512 fn dispatchrust-analyzer cargo calloop 0.10.5 sources/IdleDispatcher#dispatch().(&mut self, data: &mut Data);
513 }
514
515 impl<Data, F> IdleDispatcherrust-analyzer cargo calloop 0.10.5 sources/IdleDispatcher#<Data> for Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<F>
516 where
517 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&mut Data),
518 {
519 fn dispatchrust-analyzer cargo calloop 0.10.5 sources/impl#[`Option<F>`][`IdleDispatcher<Data>`]dispatch().(&mut self, data: &mut Data) {
520 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(callabck) = self.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_mut().() {
521 callabck(data);
522 }
523 }
524 }
525
526 #[cfg(test)]
527 mod testsrust-analyzer cargo calloop 0.10.5 sources/tests/ {
528 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::timerust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/::Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#;
529
530 use craterust-analyzer cargo calloop 0.10.5 crate/::{pingrust-analyzer cargo calloop 0.10.5 sources/ping/::make_pingrust-analyzer cargo calloop 0.10.5 sources/ping/make_ping()., EventLooprust-analyzer cargo calloop 0.10.5 loop_logic/EventLoop#};
531
532 // Test event source boxing.
533 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
534 fn test_boxed_sourcerust-analyzer cargo calloop 0.10.5 sources/tests/test_boxed_source().() {
535 let mut fired = false;
536
537 let (pinger, source) = make_pingrust-analyzer cargo calloop 0.10.5 sources/ping/make_ping().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
538 let boxed = Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(source);
539
540 let mut event_loop = EventLooprust-analyzer cargo calloop 0.10.5 loop_logic/EventLoop#::try_newrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]try_new().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
541 let handle = event_loop.handlerust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]handle().();
542
543 let token = handle
544 .insert_sourcerust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`LoopHandle<'l, Data>`]insert_source().(boxed, |_, _, fired| *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().fired = true)
545 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
546
547 pinger.pingrust-analyzer cargo calloop 0.10.5 sources/ping/eventfd/impl#[Ping]ping().();
548
549 event_loop
550 .dispatchrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]dispatch().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]new().(0, 0), &mut fired)
551 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
552
553 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(fired);
554 fired = false;
555
556 handle.updaterust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`LoopHandle<'l, Data>`]update().(&token).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
557
558 pinger.pingrust-analyzer cargo calloop 0.10.5 sources/ping/eventfd/impl#[Ping]ping().();
559
560 event_loop
561 .dispatchrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]dispatch().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]new().(0, 0), &mut fired)
562 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
563
564 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(fired);
565 fired = false;
566
567 handle.removerust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`LoopHandle<'l, Data>`]remove().(token);
568
569 event_loop
570 .dispatchrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]dispatch().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]new().(0, 0), &mut fired)
571 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
572
573 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().fired);
574 }
575
576 // Test event source trait methods via mut ref.
577 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
578 fn test_mut_ref_sourcerust-analyzer cargo calloop 0.10.5 sources/tests/test_mut_ref_source().() {
579 let mut fired = false;
580
581 let (pinger, mut source) = make_pingrust-analyzer cargo calloop 0.10.5 sources/ping/make_ping().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
582 let source_ref = &mut source;
583
584 let mut event_loop = EventLooprust-analyzer cargo calloop 0.10.5 loop_logic/EventLoop#::try_newrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]try_new().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
585 let handle = event_loop.handlerust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]handle().();
586
587 let token = handle
588 .insert_sourcerust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`LoopHandle<'l, Data>`]insert_source().(source_ref, |_, _, fired| *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().fired = true)
589 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
590
591 pinger.pingrust-analyzer cargo calloop 0.10.5 sources/ping/eventfd/impl#[Ping]ping().();
592
593 event_loop
594 .dispatchrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]dispatch().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]new().(0, 0), &mut fired)
595 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
596
597 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(fired);
598 fired = false;
599
600 handle.updaterust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`LoopHandle<'l, Data>`]update().(&token).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
601
602 pinger.pingrust-analyzer cargo calloop 0.10.5 sources/ping/eventfd/impl#[Ping]ping().();
603
604 event_loop
605 .dispatchrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]dispatch().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]new().(0, 0), &mut fired)
606 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
607
608 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(fired);
609 fired = false;
610
611 handle.removerust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`LoopHandle<'l, Data>`]remove().(token);
612
613 event_loop
614 .dispatchrust-analyzer cargo calloop 0.10.5 loop_logic/impl#[`EventLoop<'l, Data>`]dispatch().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]new().(0, 0), &mut fired)
615 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
616
617 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().fired);
618 }
619
620 // Test PostAction combinations.
621 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
622 fn post_action_combinerust-analyzer cargo calloop 0.10.5 sources/tests/post_action_combine().() {
623 use superrust-analyzer cargo calloop 0.10.5 sources/::PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#::*;
624 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#, Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#);
625 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
626 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
627 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
628
629 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
630 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
631 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
632 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
633
634 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
635 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
636 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#, Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#);
637 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
638
639 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
640 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
641 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
642 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove# |rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOr<Self>`]bitor(). Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#, Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#);
643 }
644
645 // Test PostAction self-assignment.
646 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
647 fn post_action_combine_assignrust-analyzer cargo calloop 0.10.5 sources/tests/post_action_combine_assign().() {
648 use superrust-analyzer cargo calloop 0.10.5 sources/::PostActionrust-analyzer cargo calloop 0.10.5 sources/PostAction#::*;
649
650 let mut action = Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
651 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
652 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#);
653
654 let mut action = Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
655 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
656 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
657
658 let mut action = Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
659 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
660 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
661
662 let mut action = Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
663 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
664 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
665
666 let mut action = Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
667 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
668 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
669
670 let mut action = Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
671 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
672 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
673
674 let mut action = Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
675 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
676 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
677
678 let mut action = Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
679 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
680 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
681
682 let mut action = Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
683 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
684 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
685
686 let mut action = Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
687 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
688 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
689
690 let mut action = Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
691 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
692 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#);
693
694 let mut action = Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
695 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
696 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
697
698 let mut action = Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
699 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Continuerust-analyzer cargo calloop 0.10.5 sources/PostAction#Continue#;
700 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
701
702 let mut action = Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
703 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#;
704 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
705
706 let mut action = Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
707 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Disablerust-analyzer cargo calloop 0.10.5 sources/PostAction#Disable#;
708 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Reregisterrust-analyzer cargo calloop 0.10.5 sources/PostAction#Reregister#);
709
710 let mut action = Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
711 action rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo calloop 0.10.5 sources/impl#[PostAction][`BitOrAssign<Self>`]bitor_assign().Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#;
712 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(action, Removerust-analyzer cargo calloop 0.10.5 sources/PostAction#Remove#);
713 }
714 }