pub struct CollaborationSession {
pub orchestration_id: String,
pub users: Arc<RwLock<HashMap<String, CollaborationUser>>>,
pub changes: Arc<RwLock<Vec<CollaborationChange>>>,
pub broadcast_tx: Sender<CollaborationMessage>,
pub created_at: DateTime<Utc>,
}Expand description
Collaboration session
Fields§
§orchestration_id: String§users: Arc<RwLock<HashMap<String, CollaborationUser>>>§changes: Arc<RwLock<Vec<CollaborationChange>>>§broadcast_tx: Sender<CollaborationMessage>§created_at: DateTime<Utc>Implementations§
Source§impl CollaborationSession
impl CollaborationSession
Sourcepub fn add_user(&self, user: CollaborationUser) -> Result<(), String>
pub fn add_user(&self, user: CollaborationUser) -> Result<(), String>
Add a user to the session
Sourcepub fn update_presence(
&self,
user_id: &str,
cursor: Option<CursorPosition>,
active_field: Option<String>,
) -> Result<(), String>
pub fn update_presence( &self, user_id: &str, cursor: Option<CursorPosition>, active_field: Option<String>, ) -> Result<(), String>
Update user presence
Sourcepub fn apply_change(&self, change: CollaborationChange) -> Result<(), String>
pub fn apply_change(&self, change: CollaborationChange) -> Result<(), String>
Apply a change
Sourcepub fn get_changes(&self) -> Result<Vec<CollaborationChange>, String>
pub fn get_changes(&self) -> Result<Vec<CollaborationChange>, String>
Get change history
Sourcepub fn subscribe(&self) -> Receiver<CollaborationMessage>
pub fn subscribe(&self) -> Receiver<CollaborationMessage>
Subscribe to updates
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CollaborationSession
impl !RefUnwindSafe for CollaborationSession
impl Send for CollaborationSession
impl Sync for CollaborationSession
impl Unpin 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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request