pub struct WatchedBitField {
bitfield: BitField8,
video_ids: Vec<String>,
}
Expand description
Tracks which videos have been watched.
Serialized in the format {id}:{len}:{serializedBuf}
but since {id}
might contain :
we pop gradually and then keep the rest.
Fields§
§bitfield: BitField8
§video_ids: Vec<String>
Implementations§
source§impl WatchedBitField
impl WatchedBitField
pub fn construct_from_array( arr: Vec<bool>, video_ids: Vec<String>, ) -> WatchedBitField
pub fn new(bitfield: BitField8, video_ids: Vec<String>) -> WatchedBitField
pub fn construct_with_videos( watched_field: WatchedField, video_ids: Vec<String>, ) -> Result<WatchedBitField, Error>
pub fn construct_and_resize( serialized: &str, video_ids: Vec<String>, ) -> Result<WatchedBitField, Error>
pub fn get(&self, idx: usize) -> bool
pub fn get_video(&self, video_id: &str) -> bool
pub fn set(&mut self, idx: usize, v: bool)
pub fn set_video(&mut self, video_id: &str, v: bool)
Trait Implementations§
source§impl Clone for WatchedBitField
impl Clone for WatchedBitField
source§fn clone(&self) -> WatchedBitField
fn clone(&self) -> WatchedBitField
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WatchedBitField
impl Debug for WatchedBitField
source§impl Display for WatchedBitField
impl Display for WatchedBitField
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.
source§impl From<WatchedBitField> for WatchedField
impl From<WatchedBitField> for WatchedField
source§fn from(watched_bit_field: WatchedBitField) -> Self
fn from(watched_bit_field: WatchedBitField) -> Self
Converts to this type from the input type.
source§impl PartialEq for WatchedBitField
impl PartialEq for WatchedBitField
impl Eq for WatchedBitField
impl StructuralPartialEq for WatchedBitField
Auto Trait Implementations§
impl Freeze for WatchedBitField
impl RefUnwindSafe for WatchedBitField
impl Send for WatchedBitField
impl Sync for WatchedBitField
impl Unpin for WatchedBitField
impl UnwindSafe for WatchedBitField
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
)