pub struct LivestreamState {
pub broadcaster: NodeId,
pub visual: VisualState,
pub viewer_count: u32,
pub is_live: bool,
pub title: String,
pub started_at: StateTime,
}Expand description
Visual state for livestream (asymmetric authority)
Fields§
§broadcaster: NodeIdThe broadcaster (authority)
visual: VisualStateCurrent visual state from broadcaster
viewer_count: u32Number of active viewers
is_live: boolIs the stream live?
title: StringStream title/description
started_at: StateTimeStream start time
Implementations§
Source§impl LivestreamState
impl LivestreamState
Sourcepub fn new(broadcaster: NodeId, title: String, started_at: StateTime) -> Self
pub fn new(broadcaster: NodeId, title: String, started_at: StateTime) -> Self
Create a new livestream
Sourcepub fn update_visual(&mut self, visual: VisualState) -> Result<(), &'static str>
pub fn update_visual(&mut self, visual: VisualState) -> Result<(), &'static str>
Update visual state (only broadcaster can do this)
Sourcepub fn add_viewer(&mut self)
pub fn add_viewer(&mut self)
Add a viewer
Sourcepub fn remove_viewer(&mut self)
pub fn remove_viewer(&mut self)
Remove a viewer
Sourcepub fn end_stream(&mut self)
pub fn end_stream(&mut self)
End the stream
Trait Implementations§
Source§impl Clone for LivestreamState
impl Clone for LivestreamState
Source§fn clone(&self) -> LivestreamState
fn clone(&self) -> LivestreamState
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 LivestreamState
impl RefUnwindSafe for LivestreamState
impl Send for LivestreamState
impl Sync for LivestreamState
impl Unpin for LivestreamState
impl UnsafeUnpin for LivestreamState
impl UnwindSafe for LivestreamState
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