Skip to main content

YOptions

Struct YOptions 

Source
#[repr(C)]
pub struct YOptions { pub id: u64, pub guid: *const c_char, pub collection_id: *const c_char, pub flags: 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.

§flags: u8

Boolean flags used to configure document options:

  • Y_OFFSET_BYTES: use UTF-8 byte length for text indexes and offsets.
  • Y_OFFSET_UTF16: use UTF-16 code points for text indexes and offsets.
  • Y_SKIP_GC: skip automatic garbage collection at transaction commit (useful for snapshots and keeping historical traces).
  • Y_AUTO_LOAD: all subdocuments should be loaded automatically.
  • Y_SHOULD_LOAD: should current document be synced with its provider immediatelly?
  • Y_CLEANUP_TEXT_FMT: automatically remove dangling formatting attributes.

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>,

Source§

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>,

Source§

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.