Struct Branch
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: u32A length of an indexed sequence component of a current branch node. Map component elements are computed on demand.
content_len: u32Implementations§
§impl Branch
impl Branch
pub fn new(type_ref: TypeRef) -> Box<Branch>
pub fn is_deleted(&self) -> bool
pub fn id(&self) -> BranchID
pub fn as_subdoc(&self) -> Option<Doc>
pub fn type_ref(&self) -> &TypeRef
pub fn type_ref(&self) -> &TypeRef
Returns an identifier of an underlying complex data type (eg. is it an Array or a Map).
pub fn len(&self) -> u32
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.
pub fn content_len(&self) -> u32
pub fn observe<F>(&mut self, f: F) -> Arc<dyn Drop>
pub fn observe_with<F>(&mut self, key: Origin, f: F)
pub fn unobserve(&mut self, key: &Origin) -> bool
pub fn observe_deep<F>(&self, f: F) -> Arc<dyn Drop>
pub fn observe_deep_with<F>(&self, key: Origin, f: F)
Trait Implementations§
§impl AsRef<Branch> for XmlElementRef
impl AsRef<Branch> for XmlElementRef
§impl AsRef<Branch> for XmlFragmentRef
impl AsRef<Branch> for XmlFragmentRef
§impl AsRef<Branch> for XmlHookRef
impl AsRef<Branch> for XmlHookRef
§impl AsRef<Branch> for XmlTextRef
impl AsRef<Branch> for XmlTextRef
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> 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
Mutably borrows from an owned value. Read more
§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
§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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.