#[non_exhaustive]pub enum AnySegment<'a> {
PageComposition(PageCompositionSegment),
RegionComposition(RegionCompositionSegment),
ClutDefinition(ClutDefinitionSegment),
ObjectData(ObjectDataSegment<'a>),
DisplayDefinition(DisplayDefinitionSegment),
DisparitySignalling(DisparitySignallingSegment),
AlternativeClut(AlternativeClutSegment),
EndOfDisplaySet(EndOfDisplaySetSegment),
Stuffing(StuffingSegment<'a>),
Unknown {
segment_type: u8,
page_id: u16,
data: &'a [u8],
},
}Expand description
Every crate-implemented segment type, plus an Unknown fallthrough.
serde uses external tagging with camelCase variant keys.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PageComposition(PageCompositionSegment)
RegionComposition(RegionCompositionSegment)
ClutDefinition(ClutDefinitionSegment)
ObjectData(ObjectDataSegment<'a>)
DisplayDefinition(DisplayDefinitionSegment)
DisparitySignalling(DisparitySignallingSegment)
AlternativeClut(AlternativeClutSegment)
EndOfDisplaySet(EndOfDisplaySetSegment)
Stuffing(StuffingSegment<'a>)
Unknown
Segment with an unrecognized or unsupported segment_type; data is the
segment body sans the 6-byte header (4 bytes of generic segment framing).
Implementations§
Source§impl<'a> AnySegment<'a>
impl<'a> AnySegment<'a>
Sourcepub const DISPATCHED_SEGMENT_TYPES: &'static [u8]
pub const DISPATCHED_SEGMENT_TYPES: &'static [u8]
Every segment_type the generated dispatcher routes.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Diagnostic name of the contained segment — the type’s
SegmentDef::NAME
("PAGE_COMPOSITION", "OBJECT_DATA", …); "UNKNOWN" for
AnySegment::Unknown.
Trait Implementations§
Source§impl<'a> Clone for AnySegment<'a>
impl<'a> Clone for AnySegment<'a>
Source§fn clone(&self) -> AnySegment<'a>
fn clone(&self) -> AnySegment<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for AnySegment<'a>
impl<'a> Debug for AnySegment<'a>
impl<'a> Eq for AnySegment<'a>
Source§impl<'a> From<AlternativeClutSegment> for AnySegment<'a>
impl<'a> From<AlternativeClutSegment> for AnySegment<'a>
Source§fn from(s: AlternativeClutSegment) -> Self
fn from(s: AlternativeClutSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ClutDefinitionSegment> for AnySegment<'a>
impl<'a> From<ClutDefinitionSegment> for AnySegment<'a>
Source§fn from(s: ClutDefinitionSegment) -> Self
fn from(s: ClutDefinitionSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<DisparitySignallingSegment> for AnySegment<'a>
impl<'a> From<DisparitySignallingSegment> for AnySegment<'a>
Source§fn from(s: DisparitySignallingSegment) -> Self
fn from(s: DisparitySignallingSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<DisplayDefinitionSegment> for AnySegment<'a>
impl<'a> From<DisplayDefinitionSegment> for AnySegment<'a>
Source§fn from(s: DisplayDefinitionSegment) -> Self
fn from(s: DisplayDefinitionSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<EndOfDisplaySetSegment> for AnySegment<'a>
impl<'a> From<EndOfDisplaySetSegment> for AnySegment<'a>
Source§fn from(s: EndOfDisplaySetSegment) -> Self
fn from(s: EndOfDisplaySetSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ObjectDataSegment<'a>> for AnySegment<'a>
impl<'a> From<ObjectDataSegment<'a>> for AnySegment<'a>
Source§fn from(s: ObjectDataSegment<'a>) -> Self
fn from(s: ObjectDataSegment<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PageCompositionSegment> for AnySegment<'a>
impl<'a> From<PageCompositionSegment> for AnySegment<'a>
Source§fn from(s: PageCompositionSegment) -> Self
fn from(s: PageCompositionSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<RegionCompositionSegment> for AnySegment<'a>
impl<'a> From<RegionCompositionSegment> for AnySegment<'a>
Source§fn from(s: RegionCompositionSegment) -> Self
fn from(s: RegionCompositionSegment) -> Self
Converts to this type from the input type.
Source§impl<'a> From<StuffingSegment<'a>> for AnySegment<'a>
impl<'a> From<StuffingSegment<'a>> for AnySegment<'a>
Source§fn from(s: StuffingSegment<'a>) -> Self
fn from(s: StuffingSegment<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for AnySegment<'a>
impl<'a> PartialEq for AnySegment<'a>
Source§impl<'a> Serialize for AnySegment<'a>
Available on crate feature serde only.
impl<'a> Serialize for AnySegment<'a>
Available on crate feature
serde only.impl<'a> StructuralPartialEq for AnySegment<'a>
Auto Trait Implementations§
impl<'a> Freeze for AnySegment<'a>
impl<'a> RefUnwindSafe for AnySegment<'a>
impl<'a> Send for AnySegment<'a>
impl<'a> Sync for AnySegment<'a>
impl<'a> Unpin for AnySegment<'a>
impl<'a> UnsafeUnpin for AnySegment<'a>
impl<'a> UnwindSafe for AnySegment<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more