Function pr47::util::type_assert::assert_option[][src]

pub const fn assert_option<T>() where
    Void: AssertOption<T>, 
Expand description

Assert that the type parameter T is an null-convertible Option type.

// Succeeds because std::option::Option<std::collections::Vec<u8>> is convertible
pr47::util::type_assert::assert_option::<Option<Vec<u8>>>();
// Fails because std::fs::File is not Option type
pr47::util::type_assert::assert_option::<std::fs::File>();
struct Option<T>(std::marker::PhantomData<T>);
// Fails because this Option is not std::option::Option
pr47::util::type_assert::assert_option::<Option<Vec<u8>>>();