mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-03 16:44:06 +02:00
mark Endianness trait as sealed
This commit is contained in:
parent
71823f22ec
commit
4b95909042
1 changed files with 9 additions and 1 deletions
|
|
@ -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 {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue