Struct yrs::doc::Options

source ·
pub struct Options {
    pub client_id: ClientID,
    pub guid: Uuid,
    pub collection_id: Option<String>,
    pub offset_kind: OffsetKind,
    pub skip_gc: bool,
    pub auto_load: bool,
    pub should_load: bool,
}
Expand description

Configuration options of Doc instance.

Fields§

§client_id: ClientID

Globally unique client identifier. This value must be unique across all active collaborating peers, otherwise a update collisions will happen, causing document store state to be corrupted.

Default value: randomly generated.

§guid: Uuid

A globally unique identifier for this document.

Default value: randomly generated UUID v4.

§collection_id: Option<String>

Associate this document with a collection. This only plays a role if your provider has a concept of collection.

Default value: None.

§offset_kind: OffsetKind

How to we count offsets and lengths used in text operations.

Default value: OffsetKind::Bytes.

§skip_gc: bool

Determines if transactions commits should try to perform GC-ing of deleted items.

Default value: false.

§auto_load: bool

If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.

Default value: false.

§should_load: bool

Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load().

Default value: true.

Implementations§

source§

impl Options

source

pub fn with_client_id(client_id: ClientID) -> Self

source

pub fn with_guid_and_client_id(guid: Uuid, client_id: ClientID) -> Self

Trait Implementations§

source§

impl Clone for Options

source§

fn clone(&self) -> Options

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Options

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Options

source§

fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, Error>

source§

fn decode_v1(data: &[u8]) -> Result<Self, Error>

Helper function for decoding 1st version of lib0 encoding.
source§

fn decode_v2(data: &[u8]) -> Result<Self, Error>

Helper function for decoding 2nd version of lib0 encoding.
source§

impl Default for Options

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Options

source§

fn encode<E: Encoder>(&self, encoder: &mut E)

source§

fn encode_v1(&self) -> Vec<u8>

Helper function for encoding 1st version of lib0 encoding.
source§

fn encode_v2(&self) -> Vec<u8>

Helper function for encoding 1st version of lib0 encoding.
source§

impl PartialEq for Options

source§

fn eq(&self, other: &Options) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Options

source§

impl StructuralPartialEq for Options

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.