Struct yrs::branch::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) -> Arc<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: Fn(&TransactionMut<'_>, &Event) + 'static,

source

pub fn observe_deep<F>(&self, f: F) -> Subscription
where F: Fn(&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 BranchPtr

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

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 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<'a> From<&'a Branch> for BranchPtr

source§

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

Converts to this type from the input type.
source§

impl PartialEq for Branch

source§

fn eq(&self, other: &Self) -> 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 Branch

Auto Trait Implementations§

§

impl !Freeze for Branch

§

impl !RefUnwindSafe for Branch

§

impl !Send for Branch

§

impl !Sync for Branch

§

impl Unpin for Branch

§

impl !UnwindSafe 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<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§

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

§

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.