mod arr_impls;
mod int_impls;
pub trait Bitfield {
type Storage;
}
#[cfg(feature = "gce")]
const_trait! {
#[cfg_attr(all(doc, feature = "nightly"), doc(cfg(feature = "gce")))]
pub trait NestableBitfield<S, const START: usize, const END: usize> {
type Nested<'a>: const crate::__private::NestedBitfield<'a, S>
where
S: 'a;
}
}
#[cfg(feature = "gce")]
const_trait! {
#[cfg_attr(all(doc, feature = "nightly"), doc(cfg(feature = "gce")))]
pub trait NestableMutBitfield<S, const START: usize, const END: usize> {
type NestedMut<'a>: const crate::__private::NestedMutBitfield<'a, S>
where
S: 'a;
}
}
#[cfg(feature = "gce")]
const_trait! {
#[cfg_attr(all(doc, feature = "nightly"), doc(cfg(feature = "gce")))]
pub trait NestableWriteBitfield<S, const START: usize, const END: usize> {
type NestedWrite<'a>: const crate::__private::NestedWriteBitfield<'a, S>
where
S: 'a;
}
}
const_trait! {
pub trait Bits<T> {
fn bits<const START: usize, const END: usize>(&self) -> T;
}
}
const_trait! {
pub trait WithBits<T> {
#[must_use]
fn with_bits<const START: usize, const END: usize>(self, value: T) -> Self;
}
}
const_trait! {
pub trait SetBits<T> {
fn set_bits<const START: usize, const END: usize>(&mut self, value: T);
}
}
const_trait! {
pub trait Bit {
fn bit<const BIT: usize>(&self) -> bool;
}
}
const_trait! {
pub trait WithBit {
#[must_use]
fn with_bit<const BIT: usize>(self, value: bool) -> Self;
}
}
const_trait! {
pub trait SetBit {
fn set_bit<const BIT: usize>(&mut self, value: bool);
}
}