[−][src]Struct iso7816_tlv::simple::Tag
Tag for SIMPLE-TLV data as defined in [ISO7816-4].
The tag field consists of a single byte encoding a tag number from 1 to 254. The values '00' and 'FF' are invalid for tag fields.
Tags can be generated using the TryFrom
trait
from u8 or hex str.
Example
use std::convert::TryFrom; use iso7816_tlv::simple::Tag; // get tag from u8 or &str assert!(Tag::try_from("80").is_ok()); assert!(Tag::try_from(8u8).is_ok()); assert!(Tag::try_from(0x80).is_ok()); assert!(Tag::try_from(127).is_ok()); assert!(Tag::try_from("er").is_err()); assert!(Tag::try_from("00").is_err()); assert!(Tag::try_from("ff").is_err()); // get tag as u8 let tag = Tag::try_from("80")?; let _tag_as_u8: u8 = tag.into(); let _tag_as_u8 = Into::<u8>::into(tag);
Trait Implementations
impl Clone for Tag
[src]
impl Copy for Tag
[src]
impl Debug for Tag
[src]
impl Into<u8> for Tag
[src]
impl PartialEq<Tag> for Tag
[src]
impl StructuralPartialEq for Tag
[src]
impl<'_> TryFrom<&'_ str> for Tag
[src]
type Error = TlvError
The type returned in the event of a conversion error.
fn try_from(v: &str) -> Result<Self, TlvError>
[src]
impl TryFrom<u8> for Tag
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,