Skip to main content

Banner

Struct Banner 

Source
pub struct Banner<'a> { /* private fields */ }
Expand description

Banner for displaying an icon and title on the home menu. This is the raw struct, see the plain one here.

Implementations§

Source§

impl<'a> Banner<'a>

Source

pub fn new(version: BannerVersion) -> Self

Creates a new Banner.

Source

pub fn borrow_from_slice(data: &'a [u8]) -> Result<Self, RawBannerError>

Reinterprets a &[u8] as a reference to Banner.

§Errors

This function will return an error if the input has an unknown banner version, or has the wrong size for its version, or is not aligned enough.

Source

pub fn version(&self) -> BannerVersion

Returns the version of this Banner.

Source

pub fn crc(&self, index: usize) -> u16

Returns the CRC checksum at the given index.

Source

pub fn crc_mut(&mut self, index: usize) -> &mut u16

Returns a mutable CRC checksum at the given index.

Source

pub fn bitmap(&self) -> &BannerBitmap

Returns a reference to the bitmap of this Banner.

Source

pub fn bitmap_mut(&mut self) -> &mut BannerBitmap

Returns a mutable reference to the bitmap of this Banner.

Source

pub fn palette(&self) -> &BannerPalette

Returns a reference to the palette of this Banner.

Source

pub fn palette_mut(&mut self) -> &mut BannerPalette

Returns a mutable reference to the palette of this Banner.

Source

pub fn title(&self, language: Language) -> Option<&Unicode16Array<0x80>>

Returns a title for the given language, or None the language is not supported by this banner version.

Source

pub fn title_mut( &mut self, language: Language, ) -> Option<&mut Unicode16Array<0x80>>

Returns a mutable title for the given language, or None the language is not supported by this banner version.

Source

pub fn animation(&self) -> Option<&BannerAnimation>

Returns a reference to the animation of this Banner, if it exists in this banner version.

Source

pub fn animation_mut(&mut self) -> Option<&mut BannerAnimation>

Returns a mutable reference to the animation of this Banner, if it exists in this banner version.

Source

pub fn full_data(&self) -> &[u8]

Returns a reference to the full data of this Banner.

Source

pub fn display(&self, indent: usize) -> DisplayBanner<'_>

Creates a DisplayBanner which implements Display.

Auto Trait Implementations§

§

impl<'a> Freeze for Banner<'a>

§

impl<'a> RefUnwindSafe for Banner<'a>

§

impl<'a> Send for Banner<'a>

§

impl<'a> Sync for Banner<'a>

§

impl<'a> Unpin for Banner<'a>

§

impl<'a> UnsafeUnpin for Banner<'a>

§

impl<'a> UnwindSafe for Banner<'a>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.