pub struct CollaborationHub { /* private fields */ }Expand description
The collaboration hub - manages all sessions and broadcasting
Implementations§
Source§impl CollaborationHub
impl CollaborationHub
pub fn new() -> Self
Sourcepub fn subscribe(&self) -> Receiver<CollabMessage>
pub fn subscribe(&self) -> Receiver<CollabMessage>
Subscribe to collaboration messages
Sourcepub fn join(&mut self, participant: Participant) -> String
pub fn join(&mut self, participant: Participant) -> String
Add a participant
Sourcepub fn toggle_hot_tub(&mut self, participant_id: &str) -> bool
pub fn toggle_hot_tub(&mut self, participant_id: &str) -> bool
Toggle hot tub mode for a participant
Sourcepub fn update_status(
&mut self,
participant_id: &str,
status: Option<String>,
working_on: Option<String>,
)
pub fn update_status( &mut self, participant_id: &str, status: Option<String>, working_on: Option<String>, )
Update participant status
Sourcepub fn file_activity(&mut self, participant_id: &str, action: &str, path: &str)
pub fn file_activity(&mut self, participant_id: &str, action: &str, path: &str)
Record file activity
Sourcepub fn get_presence(&self) -> Vec<ParticipantSummary>
pub fn get_presence(&self) -> Vec<ParticipantSummary>
Get current presence
Sourcepub fn get_hot_tub_participants(&self) -> Vec<&Participant>
pub fn get_hot_tub_participants(&self) -> Vec<&Participant>
Get hot tub participants
Sourcepub fn announce_prompt(&self, prompt_id: String, question: String)
pub fn announce_prompt(&self, prompt_id: String, question: String)
Broadcast an AI prompt
Sourcepub fn participant_count(&self) -> usize
pub fn participant_count(&self) -> usize
Get participant count
Sourcepub fn is_hot_tub_open(&self) -> bool
pub fn is_hot_tub_open(&self) -> bool
Check if hot tub is open
Trait Implementations§
Source§impl Debug for CollaborationHub
impl Debug for CollaborationHub
Auto Trait Implementations§
impl Freeze for CollaborationHub
impl !RefUnwindSafe for CollaborationHub
impl Send for CollaborationHub
impl Sync for CollaborationHub
impl Unpin for CollaborationHub
impl UnsafeUnpin for CollaborationHub
impl !UnwindSafe for CollaborationHub
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more