abi_stable/erased_types/
interfaces.rs1use super::*;
2use std::marker::PhantomData;
3
4#[repr(C)]
6#[derive(StableAbi)]
7#[sabi(impl_InterfaceType(Send, Sync, Clone))]
8pub struct CloneInterface;
9
10#[repr(C)]
14#[derive(StableAbi)]
15#[sabi(impl_InterfaceType(Send, Sync, Debug, Clone, Eq))]
16pub struct CloneEqInterface;
17
18#[repr(C)]
22#[derive(StableAbi)]
23#[sabi(impl_InterfaceType(Send, Sync, Debug, Clone, DoubleEndedIterator))]
24pub struct DEIteratorCloneInterface<T>(PhantomData<T>);
25
26impl<T> DEIteratorCloneInterface<T> {
27 pub const NEW: Self = Self(PhantomData);
29}
30
31impl<'a, T: 'a> IteratorItem<'a> for DEIteratorCloneInterface<T> {
32 type Item = T;
33}
34
35#[repr(C)]
39#[derive(StableAbi)]
40#[sabi(impl_InterfaceType(Send, Sync, Default))]
41pub struct DefaultInterface;
42
43#[repr(C)]
47#[derive(StableAbi)]
48#[sabi(impl_InterfaceType(Unpin))]
49pub struct UnpinInterface;
50
51#[repr(C)]
55#[derive(StableAbi)]
56#[sabi(impl_InterfaceType(Send, Sync, Debug, Eq, Default))]
57pub struct DebugDefEqInterface;
58
59#[repr(C)]
63#[derive(StableAbi)]
64#[sabi(impl_InterfaceType(Send, Sync, Debug, PartialEq))]
65pub struct PartialEqInterface;
66
67#[repr(C)]
71#[derive(StableAbi)]
72#[sabi(impl_InterfaceType(Send, Sync, Debug, FmtWrite))]
73pub struct FmtWriteInterface;
74
75#[repr(C)]
79#[derive(StableAbi)]
80#[sabi(impl_InterfaceType(IoWrite))]
81pub struct IoWriteInterface;
82
83#[repr(C)]
87#[derive(StableAbi)]
88#[sabi(impl_InterfaceType(Send, Sync, Debug, Display))]
89pub struct DebugDisplayInterface;
90
91#[repr(C)]
95#[derive(StableAbi)]
96#[sabi(impl_InterfaceType(Send, Sync, Iterator))]
97pub struct IteratorInterface<T>(PhantomData<T>);
98
99impl<T> IteratorInterface<T> {
100 pub const NEW: Self = Self(PhantomData);
102}
103
104impl<'a, T: 'a> IteratorItem<'a> for IteratorInterface<T> {
105 type Item = T;
106}
107
108#[repr(C)]
112#[derive(StableAbi)]
113#[sabi(impl_InterfaceType(Send, Sync, DoubleEndedIterator))]
114pub struct DEIteratorInterface<T>(PhantomData<T>);
115
116impl<T> DEIteratorInterface<T> {
117 pub const NEW: Self = Self(PhantomData);
119}
120
121impl<'a, T: 'a> IteratorItem<'a> for DEIteratorInterface<T> {
122 type Item = T;
123}