Skip to main content

PageHeader

Struct PageHeader 

Source
pub struct PageHeader {
Show 14 fields pub page: u8, pub s1: u8, pub s2: u8, pub s3: u8, pub s4: u8, pub erase_page: bool, pub newsflash: bool, pub subtitle: bool, pub suppress_header: bool, pub update_indicator: bool, pub interrupted_sequence: bool, pub inhibit_display: bool, pub magazine_serial: bool, pub national_option: NationalOption,
}
Available on crate feature teletext only.
Expand description

A decoded page header packet (Y = 0, ETSI EN 300 706 §9.3.1): page address, sub-code, and all eleven control bits (Table 2).

Fields§

§page: u8

Page number, Pt << 4 | Pu (§9.3.1.1; both nibbles 0x0-0xF).

§s1: u8

Page sub-code element S1 (§9.3.1.2, byte 8; 0x0-0xF).

§s2: u8

Page sub-code element S2 (byte 9 bits 2/4/6; 0x0-0x7).

§s3: u8

Page sub-code element S3 (byte 10; 0x0-0xF).

§s4: u8

Page sub-code element S4 (byte 11 bits 2/4; 0x0-0x3).

§erase_page: bool

C4 Erase Page.

§newsflash: bool

C5 Newsflash.

§subtitle: bool

C6 Subtitle.

§suppress_header: bool

C7 Suppress Header (row 0 not displayed).

§update_indicator: bool

C8 Update Indicator.

§interrupted_sequence: bool

C9 Interrupted Sequence.

§inhibit_display: bool

C10 Inhibit Display (rows 1-24 not displayed).

§magazine_serial: bool

C11 Magazine Serial (true = serial mode, false = parallel mode).

§national_option: NationalOption

C12/C13/C14 National Option Character Subset.

Implementations§

Source§

impl PageHeader

Source

pub fn parse(txt_data_block: &[u8; 42]) -> Option<PageHeader>

Decode a page header from the 8 Hamming-8/4 bytes at txt_data_block[2..10] (EN 300 706 bytes 6-13 — the 2 bytes of packet address precede these). Returns None if any of the 8 bytes is an uncorrectable Hamming-8/4 byte.

Trait Implementations§

Source§

impl Clone for PageHeader

Source§

fn clone(&self) -> PageHeader

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PageHeader

Source§

impl Debug for PageHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PageHeader

Source§

impl PartialEq for PageHeader

Source§

fn eq(&self, other: &PageHeader) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PageHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.