Struct XmlFragmentRef

Source
pub struct XmlFragmentRef(/* private fields */);
Expand description

A XML fragment, which works as an untagged collection of XML nodes.

Implementations§

Trait Implementations§

Source§

impl AsPrelim for XmlFragmentRef

Source§

type Prelim = XmlFragmentPrelim

Source§

fn as_prelim<T: ReadTxn>(&self, txn: &T) -> Self::Prelim

Converts current type contents into a Prelim type that can be used to create a new type that’s a deep copy equivalent of a current type.
Source§

impl AsRef<ArrayRef> for XmlFragmentRef

Source§

fn as_ref(&self) -> &ArrayRef

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<XmlFragmentRef> for XmlElementRef

Source§

fn as_ref(&self) -> &XmlFragmentRef

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

impl Clone for XmlFragmentRef

Source§

fn clone(&self) -> XmlFragmentRef

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 XmlFragmentRef

Source§

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

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

impl DeepObservable for XmlFragmentRef

Source§

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

Subscribe a callback f for all events emitted by this and nested collaborative types. Callback is accepting transaction which triggered that event and event itself, wrapped within an Event structure. Read more
Source§

fn observe_deep_with<K, F>(&self, key: K, f: F)
where K: Into<Origin>, F: Fn(&TransactionMut<'_>, &Events<'_>) + 'static,

Subscribe a callback f for all events emitted by this and nested collaborative types. Callback is accepting transaction which triggered that event and event itself, wrapped within an Event structure. Read more
Source§

fn unobserve_deep<K: Into<Origin>>(&self, key: K) -> bool

Unsubscribe a callback identified by a given key, that was previously subscribed using Self::observe_deep_with.
Source§

impl DefaultPrelim for XmlFragmentRef

Source§

type Prelim = XmlFragmentPrelim

Source§

fn default_prelim() -> Self::Prelim

Returns an instance of Prelim-compatible type, which will turn into reference of a current type after being integrated into the document store.
Source§

impl From<BranchPtr> for XmlFragmentRef

Source§

fn from(inner: BranchPtr) -> Self

Converts to this type from the input type.
Source§

impl GetString for XmlFragmentRef

Source§

fn get_string<T: ReadTxn>(&self, txn: &T) -> String

Converts current XML node into a textual representation. This representation if flat, it doesn’t include any indentation.

Source§

impl IndexedSequence for XmlFragmentRef

Source§

fn sticky_index( &self, txn: &mut TransactionMut<'_>, index: u32, assoc: Assoc, ) -> Option<StickyIndex>

Returns a StickyIndex equivalent to a human-readable index. Returns None if index is beyond the length of current sequence.
Source§

impl Observable for XmlFragmentRef

Source§

type Event = XmlEvent

Source§

fn observe<F>(&self, f: F) -> Subscription
where F: Fn(&TransactionMut<'_>, &Self::Event) + 'static, Event: AsRef<Self::Event>,

Subscribes a given callback to be triggered whenever current y-type is changed. A callback is triggered whenever a transaction gets committed. This function does not trigger if changes have been observed by nested shared collections. Read more
Source§

fn observe_with<K, F>(&self, key: K, f: F)
where K: Into<Origin>, F: Fn(&TransactionMut<'_>, &Self::Event) + 'static, Event: AsRef<Self::Event>,

Subscribes a given callback to be triggered whenever current y-type is changed. A callback is triggered whenever a transaction gets committed. This function does not trigger if changes have been observed by nested shared collections. Read more
Source§

fn unobserve<K: Into<Origin>>(&self, key: K) -> bool

Unsubscribes a given callback identified by key, that was previously subscribed using Self::observe_with.
Source§

impl PartialEq for XmlFragmentRef

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 RootRef for XmlFragmentRef

Source§

fn type_ref() -> TypeRef

Source§

fn root<N: Into<Arc<str>>>(name: N) -> Root<Self>

Create a logical collaborative collection reference to a root-level type with a given name
Source§

impl SharedRef for XmlFragmentRef

Source§

fn hook(&self) -> Hook<Self>

Returns a logical descriptor of a current shared collection.
Source§

impl TryFrom<ItemPtr> for XmlFragmentRef

Source§

type Error = ItemPtr

The type returned in the event of a conversion error.
Source§

fn try_from(value: ItemPtr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Out> for XmlFragmentRef

Source§

type Error = Out

The type returned in the event of a conversion error.
Source§

fn try_from(value: Out) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryInto<XmlFragmentRef> for XmlOut

Source§

type Error = XmlOut

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<XmlFragmentRef, Self::Error>

Performs the conversion.
Source§

impl XmlFragment for XmlFragmentRef

Source§

fn first_child(&self) -> Option<XmlOut>

Source§

fn children<'a, T: ReadTxn>(&self, txn: &'a T) -> XmlNodes<'a, T>

Returns an iterator over all children of a current XML fragment. It does NOT include nested children of its children - for such cases use Self::successors iterator.
Source§

fn len<T: ReadTxn>(&self, _txn: &T) -> u32

Returns a number of elements stored in current array.
Source§

fn insert<V>( &self, txn: &mut TransactionMut<'_>, index: u32, xml_node: V, ) -> V::Return
where V: XmlPrelim,

Inserts a value at the given index. Inserting at index 0 is equivalent to prepending current array with given value, while inserting at array length is equivalent to appending that value at the end of it. Read more
Source§

fn push_back<V>(&self, txn: &mut TransactionMut<'_>, xml_node: V) -> V::Return
where V: XmlPrelim,

Inserts given value at the end of the current array.
Source§

fn push_front<V>(&self, txn: &mut TransactionMut<'_>, xml_node: V) -> V::Return
where V: XmlPrelim,

Inserts given value at the beginning of the current array.
Source§

fn remove(&self, txn: &mut TransactionMut<'_>, index: u32)

Removes a single element at provided index.
Source§

fn remove_range(&self, txn: &mut TransactionMut<'_>, index: u32, len: u32)

Removes a range of elements from current array, starting at given index up until a particular number described by len has been deleted. This method panics in case when not all expected elements were removed (due to insufficient number of elements in an array) or index is outside the bounds of an array.
Source§

fn get<T: ReadTxn>(&self, _txn: &T, index: u32) -> Option<XmlOut>

Retrieves a value stored at a given index. Returns None when provided index was out of the range of a current array.
Source§

fn successors<'a, T: ReadTxn>(&'a self, txn: &'a T) -> TreeWalker<'a, &'a T, T>

Returns an iterator that can be used to traverse over the successors of a current XML element. This includes recursive step over children of its children. The recursive iteration is depth-first. Read more
Source§

impl Eq for XmlFragmentRef

Auto Trait Implementations§

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