pen_ffi/boolean.rs
1#[pen_ffi_macro::into_any(crate = "crate", into_fn = "pen_ffi_boolean_to_any")]
2#[repr(C)]
3#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
4pub struct Boolean {
5    value: bool,
6}
7
8impl Boolean {
9    pub fn new(value: bool) -> Self {
10        Self { value }
11    }
12}
13
14impl From<Boolean> for bool {
15    fn from(number: Boolean) -> Self {
16        number.value
17    }
18}
19
20impl From<bool> for Boolean {
21    fn from(value: bool) -> Self {
22        Self::new(value)
23    }
24}