Sha256: 05e2b4d8e78b0435650c6da6239ce8c53b4de2573e64ba098354b049f23429ec

Contents?: true

Size: 424 Bytes

Versions: 8

Compression:

Stored size: 424 Bytes

Contents

#[derive(Debug)]
pub(crate) struct UnsafeCell<T>(std::cell::UnsafeCell<T>);

impl<T> UnsafeCell<T> {
    pub(crate) const fn new(data: T) -> UnsafeCell<T> {
        UnsafeCell(std::cell::UnsafeCell::new(data))
    }

    pub(crate) fn with<R>(&self, f: impl FnOnce(*const T) -> R) -> R {
        f(self.0.get())
    }

    pub(crate) fn with_mut<R>(&self, f: impl FnOnce(*mut T) -> R) -> R {
        f(self.0.get())
    }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wasmtime-9.0.1 ./ext/cargo-vendor/tokio-1.28.1/src/loom/std/unsafe_cell.rs
wasmtime-8.0.0 ./ext/cargo-vendor/tokio-1.27.0/src/loom/std/unsafe_cell.rs
wasmtime-7.0.0 ./ext/cargo-vendor/tokio-1.27.0/src/loom/std/unsafe_cell.rs
wasmtime-6.0.1 ./ext/cargo-vendor/tokio-1.25.0/src/loom/std/unsafe_cell.rs
wasmtime-6.0.0 ./ext/cargo-vendor/tokio-1.25.0/src/loom/std/unsafe_cell.rs
wasmtime-5.0.0 ./ext/cargo-vendor/tokio-1.24.2/src/loom/std/unsafe_cell.rs
wasmtime-0.4.1 ./ext/cargo-vendor/tokio-1.23.0/src/loom/std/unsafe_cell.rs
wasmtime-0.4.0 ./ext/cargo-vendor/tokio-1.23.0/src/loom/std/unsafe_cell.rs