#[repr(C)]pub struct YOptions {
pub id: c_ulong,
pub guid: *const c_char,
pub collection_id: *const c_char,
pub encoding: c_int,
pub skip_gc: c_int,
pub auto_load: c_int,
pub should_load: c_int,
}Expand description
Configuration object used by YDoc.
Fields§
§id: c_ulongGlobally unique 53-bit integer assigned to corresponding document replica as its identifier.
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.
guid: *const c_charA NULL-able globally unique Uuid v4 compatible null-terminated string identifier of this document. If passed as NULL, a random Uuid will be generated instead.
collection_id: *const c_charA NULL-able, UTF-8 encoded, null-terminated string of a collection that this document belongs to. It’s used only by providers.
encoding: c_intEncoding used by text editing operations on this document. It’s used to compute
YText/YXmlText insertion offsets and text lengths. Either:
Y_ENCODING_BYTESY_ENCODING_UTF16Y_ENCODING_UTF32
skip_gc: c_intBoolean flag used to determine if deleted blocks should be garbage collected or not during the transaction commits. Setting this value to 0 means GC will be performed.
auto_load: c_intBoolean flag used to determine if subdocument should be loaded automatically. If this is a subdocument, remote peers will load the document as well automatically.
should_load: c_intBoolean flag used to determine whether the document should be synced by the provider now.