Method
poll
(fd: wasip1::Fd, event: wasip1::Eventtype)
Source from the content-addressed store, hash-verified
| 212 | } |
| 213 | |
| 214 | fn poll(fd: wasip1::Fd, event: wasip1::Eventtype) -> Result<(), wasip1::Errno> { |
| 215 | assert!( |
| 216 | unsafe { |
| 217 | wasip1::poll_oneoff( |
| 218 | [wasip1::Subscription { |
| 219 | userdata: 0, |
| 220 | u: wasip1::SubscriptionU { |
| 221 | tag: event.raw(), |
| 222 | u: wasip1::SubscriptionUU { |
| 223 | fd_read: wasip1::SubscriptionFdReadwrite { |
| 224 | file_descriptor: fd, |
| 225 | }, |
| 226 | }, |
| 227 | }, |
| 228 | }] |
| 229 | .as_ptr(), |
| 230 | MaybeUninit::<wasip1::Event>::uninit().as_mut_ptr(), |
| 231 | 1, |
| 232 | ) |
| 233 | }? == 1 |
| 234 | ); |
| 235 | |
| 236 | Ok(()) |
| 237 | } |
| 238 | |
| 239 | pub unsafe fn read( |
| 240 | &self, |
Tested by
no test coverage detected