shadow_shim_helper_rs/
lib.rs

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