Struct scryfall::set::set_code::SetCode [−][src]
A 3 or 4 letter set code, like 'war' for 'War of the Spark'.
Implementations
impl SetCode
[src]
pub fn new(code: &str) -> Result<Self, Option<usize>>
[src]
Creates a set code from a str.
Valid set codes are ascii and 3 our 6 letters long. If any of these conditions fails, the conversion fails.
The error value is None if the str
was no ascii, otherwise it holds the size
of the str
.
use scryfall::set::SetCode; assert_eq!(SetCode::new("war").unwrap().as_ref(), "war")
pub fn get(&self) -> &str
[src]
Returns a reference to the inner set code.
Trait Implementations
impl AsRef<str> for SetCode
[src]
impl Clone for SetCode
[src]
impl Copy for SetCode
[src]
impl Debug for SetCode
[src]
impl<'de> Deserialize<'de> for SetCode
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for SetCode
[src]
impl Eq for SetCode
[src]
impl Hash for SetCode
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for SetCode
[src]
fn cmp(&self, other: &SetCode) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<SetCode> for SetCode
[src]
impl PartialOrd<SetCode> for SetCode
[src]
fn partial_cmp(&self, other: &SetCode) -> Option<Ordering>
[src]
fn lt(&self, other: &SetCode) -> bool
[src]
fn le(&self, other: &SetCode) -> bool
[src]
fn gt(&self, other: &SetCode) -> bool
[src]
fn ge(&self, other: &SetCode) -> bool
[src]
impl Serialize for SetCode
[src]
impl StructuralEq for SetCode
[src]
impl StructuralPartialEq for SetCode
[src]
impl TryFrom<&'_ str> for SetCode
[src]
Auto Trait Implementations
impl RefUnwindSafe for SetCode
[src]
impl Send for SetCode
[src]
impl Sync for SetCode
[src]
impl Unpin for SetCode
[src]
impl UnwindSafe for SetCode
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,