pub struct Isbn10 { /* fields omitted */ }
Creates a new ISBN10 code from 10 digits.
use isbn::Isbn10;
let isbn10 = Isbn10::new(8, 9, 6, 6, 2, 6, 1, 2, 6, 4).unwrap();
Convert ISBN-13 to ISBN-10, if applicable.
use isbn::{Isbn10, Isbn13};
let isbn_13 = Isbn13::new(9, 7, 8, 1, 4, 9, 2, 0, 6, 7, 6, 6, 5).unwrap();
assert_eq!(Isbn10::try_from(isbn_13), "1-4920-6766-0".parse());
Hyphenate an ISBN-10 into its parts:
- Registration group
- Registrant
- Publication
- Check digit
use isbn::Isbn10;
let isbn_10 = Isbn10::new(8, 9, 6, 6, 2, 6, 1, 2, 6, 4).unwrap();
assert_eq!(isbn_10.hyphenate().unwrap().as_str(), "89-6626-126-4");
Retrieve the name of the registration group.
use isbn::Isbn10;
let isbn_10 = Isbn10::new(8, 9, 6, 6, 2, 6, 1, 2, 6, 4).unwrap();
assert_eq!(isbn_10.registration_group(), Ok("Korea, Republic"));
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Performs copy-assignment from source
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static