Struct yrs::YOptions

source ·
#[repr(C)]
pub struct YOptions { pub id: u64, pub guid: *const c_char, pub collection_id: *const c_char, pub encoding: u8, pub skip_gc: u8, pub auto_load: u8, pub should_load: u8, }
Expand description

Configuration object used by YDoc.

Fields§

§id: u64

Globally 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_char

A 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_char

A NULL-able, UTF-8 encoded, null-terminated string of a collection that this document belongs to. It’s used only by providers.

§encoding: u8

Encoding used by text editing operations on this document. It’s used to compute YText/YXmlText insertion offsets and text lengths. Either:

  • Y_OFFSET_BYTES
  • Y_OFFSET_UTF16
§skip_gc: u8

Boolean 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: u8

Boolean 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: u8

Boolean flag used to determine whether the document should be synced by the provider now.

Trait Implementations§

source§

impl From<Options> for YOptions

source§

fn from(o: Options) -> Self

Converts to this type from the input type.
source§

impl Into<Options> for YOptions

source§

fn into(self) -> Options

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.