[−][src]Struct rust_ipv8::serialization::bits::Bits
This struct represents the bits inside an u8 by unpacking them into booleans.
Mostly here to achieve feature parity with py-ipv8 see py-ipv8 code
Fields
bit0: bool
bit1: bool
bit2: bool
bit3: bool
bit4: bool
bit5: bool
bit6: bool
bit7: bool
Methods
impl Bits
[src]
pub fn new() -> Self
[src]
Creates a Bits struct with every bit set to false
pub fn from_bools(
data: (bool, bool, bool, bool, bool, bool, bool, bool)
) -> Self
[src]
data: (bool, bool, bool, bool, bool, bool, bool, bool)
) -> Self
Creates a Bits struct with the bits set to the booleans given
pub fn from_u8(num: u8) -> Self
[src]
convert an u8 into a bits struct.
pub fn to_u8(&self) -> u8
[src]
Converts the bits struct to a u8
Trait Implementations
impl PartialEq<Bits> for Bits
[src]
impl Default for Bits
[src]
impl Debug for Bits
[src]
impl Serialize for Bits
[src]
impl<'de> Deserialize<'de> for Bits
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for Bits
impl Sync for Bits
impl Send for Bits
impl RefUnwindSafe for Bits
impl UnwindSafe for Bits
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,