pub struct Streamer { /* private fields */ }Implementations§
Source§impl Streamer
impl Streamer
pub fn new() -> Arc<Self>
pub fn connected_clients(&self) -> usize
pub fn new_client(&self, s: TcpStream)
pub fn send(&self, data: &str)
pub fn send_json_with_event<T: Serialize>(&self, event: &str, data: &T)
pub fn send_with_event(&self, event: &str, data: &str)
pub fn send_json<T: Serialize>(&self, data: &T)
pub fn start<F: FnOnce(&str) -> bool + Send + 'static + Clone>( self: Arc<Self>, addr: &str, control_fn: F, ) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Streamer
impl RefUnwindSafe for Streamer
impl Send for Streamer
impl Sync for Streamer
impl Unpin for Streamer
impl UnsafeUnpin for Streamer
impl UnwindSafe for Streamer
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