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
use crate::{
    builder::Builder,
    traits::{Primitive, WriteAsOptional, WriteAsOptionalUnion, WriteAsPrimitive},
    Cursor, UnionOffset, Void,
};

impl<P: Primitive> WriteAsPrimitive<P> for Void {
    #[inline]
    fn write<const N: usize>(&self, _cursor: Cursor<'_, N>, _buffer_position: u32) {
        match *self {}
    }
}

impl<P: Primitive> WriteAsOptional<P> for () {
    type Prepared = Void;
    #[inline]
    fn prepare(&self, _builder: &mut Builder) -> Option<Void> {
        None
    }
}

impl<T: ?Sized> WriteAsOptionalUnion<T> for () {
    #[inline]
    fn prepare(&self, _builder: &mut Builder) -> Option<UnionOffset<T>> {
        None
    }
}