use std::{rc::Rc, sync::Arc};
use linera_witty::{WitLoad, WitStore, WitType};
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct SimpleWrapper(pub bool);
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct TupleWithoutPadding(pub u64, pub i32, pub i16);
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct TupleWithPadding(pub u16, pub u32, pub i64);
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct RecordWithDoublePadding {
pub first: u16,
pub second: u32,
pub third: i8,
pub fourth: i64,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct Leaf {
pub first: bool,
pub second: u128,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct Branch {
pub tag: u16,
pub first_leaf: Leaf,
pub second_leaf: Leaf,
}
#[allow(dead_code)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub enum Enum {
Empty,
LargeVariantWithLooseAlignment(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8),
SmallerVariantWithStrictAlignment { inner: u64 },
}
#[derive(Clone, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
#[witty_specialize_with(A = u8, B = i16)]
pub struct SpecializedGenericStruct<A, B> {
pub first: A,
pub second: B,
pub both: Vec<(A, B)>,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
#[witty_specialize_with(A = Option<bool>)]
#[witty_specialize_with(B = u32)]
pub enum SpecializedGenericEnum<A, B> {
None,
First(A),
MaybeSecond { maybe: Option<B> },
}
#[derive(Clone, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct StructWithHeapFields {
pub boxed: Box<SimpleWrapper>,
pub rced: Rc<Leaf>,
pub arced: Arc<Enum>,
}
#[derive(Clone, Debug, Eq, PartialEq, WitType, WitLoad, WitStore)]
pub struct StructWithLists {
pub vec: Vec<SimpleWrapper>,
pub boxed_slice: Box<[TupleWithPadding]>,
pub rced_slice: Rc<[Leaf]>,
pub arced_slice: Arc<[RecordWithDoublePadding]>,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, WitType, WitStore)]
pub struct SliceWrapper<'slice>(pub &'slice [TupleWithoutPadding]);