MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / poll

Method poll

crates/test-programs/src/preview1.rs:214–237  ·  view source on GitHub ↗
(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,

Callers 3

runFunction · 0.45
is_readyFunction · 0.45
runMethod · 0.45

Calls 1

OkFunction · 0.85

Tested by

no test coverage detected