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

pub const fn assert_const_ref<T>() where
    Void: AssertConstRef<T>, 
Expand description

Assert that the type parameter T is an immutable reference.

// Succeeds because &T is an immutable reference type
pr47::util::type_assert::assert_const_ref::<&i64>();
// Fails because std::string::String is not a reference type
pr47::util::type_assert::assert_const_ref::<String>();
// Fails because &mut T is an mutable reference, not immmutable
pr47::util::type_assert::assert_const_ref::<&mut i64>();