facet_core/types/ty/sequence.rs
1use super::Shape;
2
3/// Describes built-in sequence type (array, slice)
4#[derive(Clone, Copy, Debug)]
5#[repr(C)]
6pub enum SequenceType<'shape> {
7 /// Array (`[T; N]`)
8 Array(ArrayType<'shape>),
9
10 /// Slice (`[T]`)
11 Slice(SliceType<'shape>),
12}
13
14/// Describes a fixed-size array (`[T; N]`)
15#[derive(Clone, Copy, Debug)]
16#[repr(C)]
17pub struct ArrayType<'shape> {
18 /// Shape of the underlying object stored on array
19 pub t: &'shape Shape<'shape>,
20
21 /// Constant length of the array
22 pub n: usize,
23}
24
25/// Describes a slice (`[T]`)
26#[derive(Clone, Copy, Debug)]
27#[repr(C)]
28pub struct SliceType<'shape> {
29 /// Shape of the underlying object stored on slice
30 pub t: &'shape Shape<'shape>,
31}