pub struct LanguageCode {
pub raw: u16,
}Expand description
Two-byte ASCII language / country code packed into a single u16
register slot — the high byte is the first character, the low byte
the second character, per the SPRM 0 / 12 / 16 / 18 layout on
docs/container/dvd/application/mpucoder-sprm.html. The
0xFFFF value spelled out in the SPRM 16 / 18 default column is
the spec page’s “not specified” sentinel.
Fields§
§raw: u16The original SPRM word — exposed so a caller can round-trip
the slot bit-for-bit including the 0xFFFF sentinel.
Implementations§
Source§impl LanguageCode
impl LanguageCode
Sourcepub const NOT_SPECIFIED: u16 = 0xFFFF
pub const NOT_SPECIFIED: u16 = 0xFFFF
0xFFFF — the SPRM 16 / 18 default “preferred language not
specified” sentinel.
Sourcepub fn is_not_specified(self) -> bool
pub fn is_not_specified(self) -> bool
true when the slot encodes the 0xFFFF “not specified”
sentinel used by the SPRM 16 / 18 defaults.
Sourcepub fn ascii_bytes(self) -> Option<[u8; 2]>
pub fn ascii_bytes(self) -> Option<[u8; 2]>
Return the two-byte ASCII code as a [u8; 2] when the slot
carries one (i.e. is not the 0xFFFF sentinel and both bytes
are printable ASCII letters per ISO 639 / ISO 3166). Returns
None otherwise — including the “player specific” default
for SPRM 0 / 12 (which has no on-wire representation; the
spec leaves the slot uninitialised).
Trait Implementations§
Source§impl Clone for LanguageCode
impl Clone for LanguageCode
Source§fn clone(&self) -> LanguageCode
fn clone(&self) -> LanguageCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LanguageCode
Source§impl Debug for LanguageCode
impl Debug for LanguageCode
impl Eq for LanguageCode
Source§impl PartialEq for LanguageCode
impl PartialEq for LanguageCode
Source§fn eq(&self, other: &LanguageCode) -> bool
fn eq(&self, other: &LanguageCode) -> bool
self and other values to be equal, and is used by ==.