shadow_shim_helper_rs/
lib.rs

1// https://github.com/rust-lang/rfcs/blob/master/text/2585-unsafe-block-in-unsafe-fn.md
2#![deny(unsafe_op_in_unsafe_fn)]
3// we do some static assertions to make sure C bindings are okay.
4#![allow(clippy::assertions_on_constants)]
5
6use vasi::VirtualAddressSpaceIndependent;
7
8pub mod emulated_time;
9pub mod explicit_drop;
10pub mod ipc;
11pub mod notnull;
12pub mod option;
13pub mod rootedcell;
14pub mod shadow_syscalls;
15pub mod shim_event;
16pub mod shim_shmem;
17pub mod simulation_time;
18pub mod syscall_types;
19pub mod util;
20
21#[repr(transparent)]
22#[derive(
23    Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone, VirtualAddressSpaceIndependent,
24)]
25pub struct HostId(u32);
26
27impl From<u32> for HostId {
28    fn from(i: u32) -> Self {
29        HostId(i)
30    }
31}
32
33impl From<HostId> for u32 {
34    fn from(i: HostId) -> Self {
35        i.0
36    }
37}
38
39// Force cargo to link against crates that aren't (yet) referenced from Rust
40// code (but are referenced from this crate's C code).
41// https://github.com/rust-lang/cargo/issues/9391
42extern crate logger;
43extern crate shadow_shmem;