Struct Options
pub struct Options {
pub client_id: u64,
pub guid: Arc<str>,
pub collection_id: Option<Arc<str>>,
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: u64Globally 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: Arc<str>A globally unique identifier for this document.
Default value: randomly generated UUID v4.
collection_id: Option<Arc<str>>Associate this document with a collection. This only plays a role if your provider has a concept of collection.
Default value: None.
offset_kind: OffsetKindHow to we count offsets and lengths used in text operations.
Default value: OffsetKind::Bytes.
skip_gc: boolDetermines if transactions commits should try to perform GC-ing of deleted items.
Default value: false.
auto_load: boolIf a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.
Default value: false.
should_load: boolWhether the document should be synced by the provider now. This is toggled to true when you call ydoc.load().
Default value: true.
Implementations§
§impl Options
impl Options
pub fn with_client_id(client_id: u64) -> Options
pub fn with_guid_and_client_id(guid: Arc<str>, client_id: u64) -> Options
Trait Implementations§
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more