1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Types shared by every bridge module: the unified error enum and small POD structs.
#[diplomat::bridge]
pub mod ffi {
/// Every fallible method in the bridge returns `Result<T, NucleationError>` —
/// see `stencil/docs/nucleation-error.md` for how these variants were derived from
/// the three error conventions the old hand-written `ffi` module mixed.
#[diplomat::attr(auto, error)]
#[derive(PartialEq, Eq, Debug)]
pub enum NucleationError {
NullArgument,
InvalidArgument,
Parse,
Serialize,
Io,
Lock,
Store,
Mesh,
Render,
Simulation,
AlreadyConsumed,
NotFound,
/// A world-generation source failed while producing a chunk, even though
/// the request itself was well-formed (see `world_generation`).
Generation,
}
#[diplomat::attr(auto, abi_compatible)]
#[derive(Copy, Clone)]
pub struct Dimensions {
pub x: i32,
pub y: i32,
pub z: i32,
}
#[diplomat::attr(auto, abi_compatible)]
#[derive(Copy, Clone)]
pub struct BlockPos {
pub x: i32,
pub y: i32,
pub z: i32,
}
}