Trait twelve_bit::u12::FailableInto [] [src]

pub trait FailableInto<T> where Self: Sized, T: Sized {
    fn failable_into(self) -> Option<T>;

    fn unchecked_into(self) -> T { ... }

Trait for implementing failable conversions in a generic way.

Required Methods

fn failable_into(self) -> Option<T>

Returns the receiver as Some(T) if non-truncating, or None.

Provided Methods

fn unchecked_into(self) -> T

Returns the receiver as T by using failable_into() and unwrapping the result.


This method will panic if failable_into fails.