rust-lightning/src/util/internal_traits.rs

8 lines
317 B
Rust
Raw Normal View History

2017-12-25 01:05:27 -05:00
/// A simple marker trait that indicates a type requires no deallocation. Implies we can set_len()
/// on a Vec of these things and will be safe to overwrite them with =.
pub unsafe trait NoDealloc {}
/// Just call with test_no_dealloc::<Type>(None)
#[inline]
pub fn test_no_dealloc<T : NoDealloc>(_: Option<T>) { }