Function yrs::ydoc_new_with_id[][src]

#[no_mangle]
pub extern "C" fn ydoc_new_with_id(id: c_ulong) -> *mut Doc
Expand description

Creates a new Doc instance with a specified client id. Provided id must be unique across all collaborating clients.

If two clients share the same id and will perform any updates, it will result in unrecoverable document state corruption. The same thing may happen if the client restored document state from snapshot, that didn’t contain all of that clients updates that were sent to other peers.

Use ydoc_destroy in order to release created Doc resources.