Struct stremio_watched_bitfield::bitfield8::BitField8
source · pub struct BitField8 {
pub length: usize,
pub(crate) values: Vec<u8>,
}
Fields§
§length: usize
§values: Vec<u8>
Implementations§
source§impl BitField8
impl BitField8
pub fn new(length: usize) -> BitField8
pub fn get(&self, i: usize) -> bool
sourcepub fn new_with_values(values: Vec<u8>, length: Option<usize>) -> Self
pub fn new_with_values(values: Vec<u8>, length: Option<usize>) -> Self
Creates a new BitField8
using the passed values and an optional
length for the struct.
If length is None
a default value of values.len() * 8
will be used.
pub fn set(&mut self, i: usize, val: bool)
sourcepub fn last_index_of(&self, val: bool) -> Option<usize>
pub fn last_index_of(&self, val: bool) -> Option<usize>
get the last index where the value is true
or false
(val
)
Trait Implementations§
source§impl<'de> Deserialize<'de> for BitField8
impl<'de> Deserialize<'de> for BitField8
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<WatchedBitField> for BitField8
impl From<WatchedBitField> for BitField8
source§fn from(watched: WatchedBitField) -> Self
fn from(watched: WatchedBitField) -> Self
Converts to this type from the input type.
impl Eq for BitField8
impl StructuralPartialEq for BitField8
Auto Trait Implementations§
impl Freeze for BitField8
impl RefUnwindSafe for BitField8
impl Send for BitField8
impl Sync for BitField8
impl Unpin for BitField8
impl UnwindSafe for BitField8
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)