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-29.0.0 ./ext/cargo-vendor/mio-1.0.3/src/sys/windows/waker.rs
wasmtime-28.0.0 ./ext/cargo-vendor/mio-1.0.3/src/sys/windows/waker.rs
wasmtime-27.0.0 ./ext/cargo-vendor/mio-1.0.2/src/sys/windows/waker.rs
wasmtime-26.0.0 ./ext/cargo-vendor/mio-1.0.2/src/sys/windows/waker.rs
wasmtime-25.0.2 ./ext/cargo-vendor/mio-1.0.2/src/sys/windows/waker.rs
wasmtime-25.0.1 ./ext/cargo-vendor/mio-1.0.2/src/sys/windows/waker.rs
wasmtime-25.0.0 ./ext/cargo-vendor/mio-1.0.2/src/sys/windows/waker.rs
wasmtime-24.0.0 ./ext/cargo-vendor/mio-1.0.2/src/sys/windows/waker.rs
wasmtime-23.0.2 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-22.0.0 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-21.0.1 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-20.0.2 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-20.0.0 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-18.0.3 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-17.0.1 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-17.0.0 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-16.0.0 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-15.0.1 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-15.0.0 ./ext/cargo-vendor/mio-0.8.10/src/sys/windows/waker.rs
wasmtime-14.0.4 ./ext/cargo-vendor/mio-0.8.9/src/sys/windows/waker.rs