pub struct CollaborationSession {
pub id: String,
pub document_id: DocumentId,
pub participants: Vec<Participant>,
pub started: DateTime<Utc>,
pub status: SessionStatus,
}Expand description
A collaborative editing session.
Fields§
§id: StringSession ID.
document_id: DocumentIdDocument being collaborated on.
participants: Vec<Participant>Current participants.
started: DateTime<Utc>When the session started.
status: SessionStatusSession status.
Implementations§
Source§impl CollaborationSession
impl CollaborationSession
Sourcepub fn new(id: impl Into<String>, document_id: DocumentId) -> Self
pub fn new(id: impl Into<String>, document_id: DocumentId) -> Self
Create a new collaboration session.
Sourcepub fn add_participant(&mut self, participant: Participant)
pub fn add_participant(&mut self, participant: Participant)
Add a participant.
Sourcepub fn remove_participant(&mut self, user_id: &str)
pub fn remove_participant(&mut self, user_id: &str)
Remove a participant by user ID.
Sourcepub fn participant_count(&self) -> usize
pub fn participant_count(&self) -> usize
Get the number of participants.
Trait Implementations§
Source§impl Clone for CollaborationSession
impl Clone for CollaborationSession
Source§fn clone(&self) -> CollaborationSession
fn clone(&self) -> CollaborationSession
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 moreSource§impl Debug for CollaborationSession
impl Debug for CollaborationSession
Source§impl<'de> Deserialize<'de> for CollaborationSession
impl<'de> Deserialize<'de> for CollaborationSession
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CollaborationSession
impl PartialEq for CollaborationSession
Source§impl Serialize for CollaborationSession
impl Serialize for CollaborationSession
impl StructuralPartialEq for CollaborationSession
Auto Trait Implementations§
impl Freeze for CollaborationSession
impl RefUnwindSafe for CollaborationSession
impl Send for CollaborationSession
impl Sync for CollaborationSession
impl Unpin for CollaborationSession
impl UnsafeUnpin for CollaborationSession
impl UnwindSafe for CollaborationSession
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