1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 08:34:07 +02:00

mark Endianness trait as sealed

This commit is contained in:
Robin Appelman 2019-04-09 20:09:55 +02:00
commit 4b95909042

View file

@ -1,5 +1,5 @@
/// Trait for specifying endianness of bit buffer
pub trait Endianness {
pub trait Endianness: private::Sealed {
/// Input is little endian
fn is_le() -> bool;
/// Input is big endian
@ -32,3 +32,11 @@ macro_rules! impl_endianness {
impl_endianness!(BigEndian, false);
impl_endianness!(LittleEndian, true);
mod private {
pub trait Sealed {}
// Implement for those same types, but no others.
impl Sealed for super::BigEndian {}
impl Sealed for super::LittleEndian {}
}