calimero-sys 0.8.0

Core Calimero infrastructure and tools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[repr(C)]
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Bool(u32);

impl TryFrom<Bool> for bool {
    type Error = u32;

    #[inline]
    fn try_from(value: Bool) -> Result<Self, Self::Error> {
        match value {
            Bool(0) => Ok(false),
            Bool(1) => Ok(true),
            Bool(x) => Err(x),
        }
    }
}