[][src]Struct isbn::Isbn13

pub struct Isbn13 { /* fields omitted */ }

13-digit ISBN format.

Methods

impl Isbn13
[src]

pub fn new(
    a: u8,
    b: u8,
    c: u8,
    d: u8,
    e: u8,
    f: u8,
    g: u8,
    h: u8,
    i: u8,
    j: u8,
    k: u8,
    l: u8,
    m: u8
) -> IsbnResult<Isbn13>
[src]

Creates a new ISBN13 code from 13 digits.

Examples

use isbn::Isbn13;

let isbn13 = Isbn13::new(9, 7, 8, 1, 4, 9, 2, 0, 6, 7, 6, 6, 5).unwrap();

pub fn hyphenate(&self) -> Result<ArrayString<[u8; 17]>, IsbnError>
[src]

Hyphenate an ISBN-13 into its parts:

  • GS1 Prefix
  • Registration group
  • Registrant
  • Publication
  • Check digit
use isbn::Isbn13;

let isbn_13 = Isbn13::new(9, 7, 8, 1, 4, 9, 2, 0, 6, 7, 6, 6, 5).unwrap();
assert_eq!(isbn_13.hyphenate().unwrap().as_str(), "978-1-4920-6766-5");

pub fn registration_group(&self) -> Result<&str, IsbnError>
[src]

Retrieve the name of the registration group.

use isbn::Isbn13;

let isbn_13 = Isbn13::new(9, 7, 8, 1, 4, 9, 2, 0, 6, 7, 6, 6, 5).unwrap();
assert_eq!(isbn_13.registration_group(), Ok("English language"));

Trait Implementations

impl Copy for Isbn13
[src]

impl Display for Isbn13
[src]

impl Debug for Isbn13
[src]

impl PartialEq<Isbn13> for Isbn13
[src]

impl FromStr for Isbn13
[src]

type Err = IsbnError

The associated error which can be returned from parsing.

impl Hash for Isbn13
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl From<Isbn13> for Isbn
[src]

impl From<Isbn10> for Isbn13
[src]

impl Clone for Isbn13
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Isbn13

impl Sync for Isbn13

Blanket Implementations

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T
[src]

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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