[][src]Struct iso7816_tlv::simple::Tag

pub struct Tag(_);

Tag for SIMPLE-TLV data as defined in [ISO7819-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;

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());

Trait Implementations

impl Clone for Tag[src]

impl PartialEq<Tag> for Tag[src]

impl Debug for Tag[src]

impl TryFrom<u8> for Tag[src]

type Error = TlvError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ str> for Tag[src]

type Error = TlvError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl Send for Tag

impl Unpin for Tag

impl Sync for Tag

impl UnwindSafe for Tag

impl RefUnwindSafe for Tag

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]