pub struct LivestreamInterest {
pub stream_id: u64,
pub interests: InterestMap,
pub active_viewers: HashSet<NodeId>,
pub lurkers: HashSet<NodeId>,
}Expand description
Livestream interest - specialized for streaming scenarios
Fields§
§stream_id: u64Stream ID
interests: InterestMapInterest map for this stream
active_viewers: HashSet<NodeId>Active viewers (high interest in visual/audio)
lurkers: HashSet<NodeId>Lurkers (low interest, just presence)
Implementations§
Source§impl LivestreamInterest
impl LivestreamInterest
Sourcepub fn add_viewer(&mut self, node: NodeId)
pub fn add_viewer(&mut self, node: NodeId)
Add an active viewer
Sourcepub fn add_lurker(&mut self, node: NodeId)
pub fn add_lurker(&mut self, node: NodeId)
Add a lurker (low bandwidth mode)
Sourcepub fn remove_viewer(&mut self, node: NodeId)
pub fn remove_viewer(&mut self, node: NodeId)
Remove a viewer
Sourcepub fn viewer_count(&self) -> usize
pub fn viewer_count(&self) -> usize
Get total viewer count
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get active viewer count
Trait Implementations§
Source§impl Clone for LivestreamInterest
impl Clone for LivestreamInterest
Source§fn clone(&self) -> LivestreamInterest
fn clone(&self) -> LivestreamInterest
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for LivestreamInterest
impl RefUnwindSafe for LivestreamInterest
impl Send for LivestreamInterest
impl Sync for LivestreamInterest
impl Unpin for LivestreamInterest
impl UnsafeUnpin for LivestreamInterest
impl UnwindSafe for LivestreamInterest
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