pub struct Menu<'a> {
pub more: bool,
pub choice_nb: u8,
pub title: Text<'a>,
pub subtitle: Text<'a>,
pub bottom: Text<'a>,
pub choices: Vec<Text<'a>>,
}Expand description
menu() object (Table 49) and list() object (Table 51) share this layout:
choice_nb / item_nb, three header TEXT()s, then the choice/item TEXT()s.
Menu::more selects the _last vs _more tag and is set from the parsed
tag. 0xFF for the count means “count not carried; read to end of object”.
Fields§
§more: booltrue = _more tag (more APDUs follow); false = _last.
choice_nb: u8choice_nb / item_nb — 0xFF means the count is not carried on the wire.
title: Text<'a>Title TEXT().
subtitle: Text<'a>Sub-title TEXT().
bottom: Text<'a>Bottom-line TEXT().
choices: Vec<Text<'a>>The per-choice / per-item TEXT()s, in wire order.
Implementations§
Source§impl<'a> Menu<'a>
impl<'a> Menu<'a>
The menu apdu_tag for this object given Menu::more.
Sourcepub fn list_tag(&self) -> ApduTag
pub fn list_tag(&self) -> ApduTag
The list apdu_tag for this object given Menu::more (for use as a
List).
Sourcepub fn parse_list(bytes: &'a [u8]) -> Result<Self>
pub fn parse_list(bytes: &'a [u8]) -> Result<Self>
Parse a list() object (Tables 51) from a complete APDU.
Sourcepub fn list_serialized_len(&self) -> usize
pub fn list_serialized_len(&self) -> usize
Serialized length of this object as a list() (identical to a menu).
Sourcepub fn serialize_list(&self, buf: &mut [u8]) -> Result<usize>
pub fn serialize_list(&self, buf: &mut [u8]) -> Result<usize>
Serialize this object as a list() into buf.
Trait Implementations§
impl<'a> Eq for Menu<'a>
Source§impl Serialize for Menu<'_>
impl Serialize for Menu<'_>
Source§type Error = Error
type Error = Error
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
serialize_into will write.