[−][src]Struct cannyls::lump::LumpId
Lumpの識別子(128bit幅).
Methods
impl LumpId
[src]
impl LumpId
pub const SIZE: usize
[src]
識別子のバイト幅.
pub fn new(id: u128) -> Self | [src] |
新しいLumpId
インスタンスを生成する.
Examples
use cannyls::lump::LumpId; assert_eq!(LumpId::new(0x12_3456).to_string(), "00000000000000000000000000123456"); // 16進数文字列からも生成可能 assert_eq!("123456".parse::<LumpId>().unwrap(), LumpId::new(0x12_3456));
pub fn as_u128(&self) -> u128 | [src] |
識別子の値(128bit整数)を返す.
Trait Implementations
impl Clone for LumpId
[src]
impl Clone for LumpId
fn clone(&self) -> LumpId | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Ord for LumpId
[src]
impl Ord for LumpId
fn cmp(&self, other: &LumpId) -> Ordering | [src] |
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
impl Eq for LumpId
[src]
impl Eq for LumpId
impl Copy for LumpId
[src]
impl Copy for LumpId
impl PartialOrd<LumpId> for LumpId
[src]
impl PartialOrd<LumpId> for LumpId
fn partial_cmp(&self, other: &LumpId) -> Option<Ordering> | [src] |
fn lt(&self, other: &LumpId) -> bool | [src] |
fn le(&self, other: &LumpId) -> bool | [src] |
fn gt(&self, other: &LumpId) -> bool | [src] |
fn ge(&self, other: &LumpId) -> bool | [src] |
impl PartialEq<LumpId> for LumpId
[src]
impl PartialEq<LumpId> for LumpId
impl Display for LumpId
[src]
impl Display for LumpId
impl Debug for LumpId
[src]
impl Debug for LumpId
impl Hash for LumpId
[src]
impl Hash for LumpId
fn hash<__H: Hasher>(&self, state: &mut __H) | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for LumpId
[src]
impl FromStr for LumpId
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self> | [src] |
16進数表記の数値からLumpId
を生成する.
数値の"128bit整数"として扱われ、先頭のゼロは省略可能("ab12"
と"00ab12"
は等価).
Errors
以下のいずれかの場合には、種類がErrorKind::InvalidInput
のエラーが返される:
- 文字列が16進数表記の整数値を表していない
- 文字列の長さが32文字を超えている
Examples
use std::str::{self, FromStr}; use cannyls::ErrorKind; use cannyls::lump::LumpId; assert_eq!(LumpId::from_str("00ab12").ok(), Some(LumpId::new(0xab12))); assert_eq!(LumpId::from_str("foo_bar").err().map(|e| *e.kind()), Some(ErrorKind::InvalidInput)); let large_input = str::from_utf8(&[b'a', 33][..]).unwrap(); assert_eq!(LumpId::from_str(large_input).err().map(|e| *e.kind()), Some(ErrorKind::InvalidInput));
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |