Struct Doc

Source
pub struct Doc {
    pub publisher: Arc<DocPublisher>,
    /* private fields */
}

Fields§

§publisher: Arc<DocPublisher>

Implementations§

Source§

impl Doc

Source

pub fn with_options(options: DocOptions) -> Self

Source

pub fn with_client(client_id: u64) -> Self

Source

pub fn client(&self) -> Client

Source

pub fn guid(&self) -> &str

Source

pub fn new_from_binary(binary: Vec<u8>) -> JwstCodecResult<Self>

Source

pub fn new_from_binary_with_options( binary: Vec<u8>, options: DocOptions, ) -> JwstCodecResult<Self>

Source

pub fn apply_update_from_binary(&mut self, update: Vec<u8>) -> JwstCodecResult

Source

pub fn apply_update(&mut self, update: Update) -> JwstCodecResult

Source

pub fn keys(&self) -> Vec<String>

Source

pub fn get_or_create_text(&self, name: &str) -> JwstCodecResult<Text>

Source

pub fn create_text(&self) -> JwstCodecResult<Text>

Source

pub fn get_or_create_array(&self, str: &str) -> JwstCodecResult<Array>

Source

pub fn create_array(&self) -> JwstCodecResult<Array>

Source

pub fn get_or_create_map(&self, str: &str) -> JwstCodecResult<Map>

Source

pub fn create_map(&self) -> JwstCodecResult<Map>

Source

pub fn get_map(&self, str: &str) -> JwstCodecResult<Map>

Source

pub fn encode_update_v1(&self) -> JwstCodecResult<Vec<u8>>

Source

pub fn encode_state_as_update_v1( &self, sv: &StateVector, ) -> JwstCodecResult<Vec<u8>>

Source

pub fn get_state_vector(&self) -> StateVector

Source

pub fn subscribe(&self, cb: impl Fn(&[u8]) + Sync + Send + 'static)

Source

pub fn unsubscribe_all(&self)

Trait Implementations§

Source§

impl Clone for Doc

Source§

fn clone(&self) -> Doc

Returns a duplicate 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 Doc

Source§

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

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

impl Default for Doc

Source§

fn default() -> Self

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

impl From<Doc> for Value

Source§

fn from(value: Doc) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Doc

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Send for Doc

Source§

impl Sync for Doc

Auto Trait Implementations§

§

impl Freeze for Doc

§

impl RefUnwindSafe for Doc

§

impl Unpin for Doc

§

impl UnwindSafe for Doc

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V