Skip to main content

Branch

Struct Branch 

Source
pub struct Branch {
    pub block_len: u32,
    pub content_len: u32,
    /* private fields */
}
Expand description

Branch describes a content of a complex Yrs data structures, such as arrays or maps.

Fields§

§block_len: u32

A length of an indexed sequence component of a current branch node. Map component elements are computed on demand.

§content_len: u32

Implementations§

Source§

impl Branch

Source

pub fn new(type_ref: TypeRef) -> Box<Self>

Source

pub fn is_deleted(&self) -> bool

Source

pub fn id(&self) -> BranchID

Source

pub fn as_subdoc(&self) -> Option<Doc>

Source

pub fn type_ref(&self) -> &TypeRef

Returns an identifier of an underlying complex data type (eg. is it an Array or a Map).

Source

pub fn len(&self) -> u32

Returns a length of an indexed sequence component of a current branch node. Map component elements are computed on demand.

Source

pub fn content_len(&self) -> u32

Source

pub fn observe<F>(&mut self, f: F) -> Subscription
where F: FnMut(&TransactionMut<'_>, &Event) + 'static,

Source

pub fn observe_with<F>(&mut self, key: Origin, f: F)
where F: FnMut(&TransactionMut<'_>, &Event) + 'static,

Source

pub fn unobserve(&mut self, key: &Origin) -> bool

Source

pub fn observe_deep<F>(&mut self, f: F) -> Subscription
where F: FnMut(&TransactionMut<'_>, &Events<'_>) + 'static,

Source

pub fn observe_deep_with<F>(&mut self, key: Origin, f: F)
where F: FnMut(&TransactionMut<'_>, &Events<'_>) + 'static,

Trait Implementations§

Source§

impl AsMut<Branch> for BranchPtr

Source§

fn as_mut(&mut self) -> &mut Branch

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for ArrayRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for MapRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for TextRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for XmlOut

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for XmlElementRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for XmlTextRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for XmlFragmentRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for XmlHookRef

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Branch> for BranchPtr

Source§

fn as_ref(&self) -> &Branch

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for Branch

Source§

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

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

impl Display for Branch

Source§

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

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

impl Eq for Branch

Source§

impl<'a> From<&'a Box<Branch>> for BranchPtr

Source§

fn from(branch: &'a Box<Branch>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Branch> for BranchPtr

Source§

fn from(branch: &'a Branch) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut Box<Branch>> for BranchPtr

Source§

fn from(branch: &'a mut Box<Branch>) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Branch

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Branch

§

impl !Send for Branch

§

impl !Sync for Branch

§

impl !UnwindSafe for Branch

§

impl Freeze for Branch

§

impl Unpin for Branch

§

impl UnsafeUnpin for Branch

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.