pub struct ClientConnection { /* private fields */ }Implementations§
Source§impl ClientConnection
impl ClientConnection
pub fn new( doc_server: Arc<dyn DocServer>, send_callback: Sender<Vec<u8>>, timeout: Duration, default_context: HashMap<String, String>, ) -> Self
pub fn socket_id(&self) -> &str
pub fn is_closed(&self) -> bool
pub fn close(&self) -> Result<()>
Sourcepub async fn handle_message(&self, data: &[u8]) -> Result<()>
pub async fn handle_message(&self, data: &[u8]) -> Result<()>
Handle incoming message for a specific document The document name must be provided separately as the ysweet protocol doesn’t include document names in the message payload
pub fn get_context(&self, key: &str) -> Option<String>
pub fn set_context(&self, key: String, value: String)
pub fn get_document_count(&self) -> usize
pub fn has_document(&self, document_name: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientConnection
impl !RefUnwindSafe for ClientConnection
impl Send for ClientConnection
impl Sync for ClientConnection
impl Unpin for ClientConnection
impl !UnwindSafe for ClientConnection
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