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
use std::any::TypeId;

use xjbutil::either::Either;

use crate::data::tyck::TyckInfo;
use crate::data::exception::{CheckedException, UncheckedException};

pub mod sync_fn;

#[cfg(feature = "async")]
pub mod async_fn;

pub enum DataOption {
    Share,
    MutShare,
    Move,
    Copy,
    Raw,
    RawUntyped
}

pub struct Signature {
    pub param_types: Box<[TyckInfo]>,
    pub param_options: Box<[DataOption]>,
    pub ret_type: Box<[TyckInfo]>,
    pub ret_option: Box<[DataOption]>,
    pub exceptions: Box<[TypeId]>
}

pub type FFIException = Either<CheckedException, UncheckedException>;