Sha256: cf27f75061b86dabe362d936c5945fd0e644aea833993de45d40b4be5fbbe56c

Contents?: true

Size: 598 Bytes

Versions: 38

Compression:

Stored size: 598 Bytes

Contents

use crate::sys::windows::Event;
use crate::sys::windows::Selector;
use crate::Token;

use super::iocp::CompletionPort;
use std::io;
use std::sync::Arc;

#[derive(Debug)]
pub struct Waker {
    token: Token,
    port: Arc<CompletionPort>,
}

impl Waker {
    pub fn new(selector: &Selector, token: Token) -> io::Result<Waker> {
        Ok(Waker {
            token,
            port: selector.clone_port(),
        })
    }

    pub fn wake(&self) -> io::Result<()> {
        let mut ev = Event::new(self.token);
        ev.set_readable();

        self.port.post(ev.to_completion_status())
    }
}

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
wasmtime-14.0.3 ./ext/cargo-vendor/mio-0.8.9/src/sys/windows/waker.rs
wasmtime-14.0.1 ./ext/cargo-vendor/mio-0.8.9/src/sys/windows/waker.rs
wasmtime-14.0.0 ./ext/cargo-vendor/mio-0.8.9/src/sys/windows/waker.rs
wasmtime-13.0.0 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-12.0.1 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-12.0.0 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-11.0.0 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-10.0.1 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-10.0.0 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-9.0.4 ./ext/cargo-vendor/mio-0.8.8/src/sys/windows/waker.rs
wasmtime-9.0.1 ./ext/cargo-vendor/mio-0.8.6/src/sys/windows/waker.rs
wasmtime-8.0.0 ./ext/cargo-vendor/mio-0.8.6/src/sys/windows/waker.rs
wasmtime-7.0.0 ./ext/cargo-vendor/mio-0.8.6/src/sys/windows/waker.rs
wasmtime-6.0.1 ./ext/cargo-vendor/mio-0.8.6/src/sys/windows/waker.rs
wasmtime-6.0.0 ./ext/cargo-vendor/mio-0.8.6/src/sys/windows/waker.rs
wasmtime-5.0.0 ./ext/cargo-vendor/mio-0.8.5/src/sys/windows/waker.rs
wasmtime-0.4.1 ./ext/cargo-vendor/mio-0.8.5/src/sys/windows/waker.rs
wasmtime-0.4.0 ./ext/cargo-vendor/mio-0.8.5/src/sys/windows/waker.rs