Skip to main content

devela/code/marker/
repr.rs

1// devela/src/code/marker/repr.rs
2//
3//! Defines [`Repr`].
4//
5
6#[doc = crate::_tags!(code data)]
7/// Selects how a value exposes one of its representations.
8#[doc = crate::_doc_meta!{
9    location("code/marker", enum ReprMode),
10    test_size_of(ReprMode = 1|8; niche Option),
11}]
12#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
13pub enum ReprMode {
14    #[doc = crate::_tags!(init)]
15    /// Shows the direct underlying representation.
16    #[default]
17    Raw,
18    /// Shows named semantic parts when available.
19    Named,
20    /// Shows both the direct representation and named semantic parts.
21    RawNamed,
22}
23crate::_impl_init![Self::Raw => ReprMode];
24impl crate::BitSized<3> for ReprMode {}