pub enum Out {
Any(Any),
YText(TextRef),
YArray(ArrayRef),
YMap(MapRef),
YXmlElement(XmlElementRef),
YXmlFragment(XmlFragmentRef),
YXmlText(XmlTextRef),
YDoc(Doc),
UndefinedRef(BranchPtr),
}Expand description
Value that can be returned by Yrs data types. This includes Any which is an extension representation of JSON, but also nested complex collaborative structures specific to Yrs.
Variants§
Any(Any)
Any value that it treated as a single element in its entirety.
YText(TextRef)
Instance of a TextRef.
YArray(ArrayRef)
Instance of an ArrayRef.
YMap(MapRef)
Instance of a MapRef.
YXmlElement(XmlElementRef)
Instance of a XmlElementRef.
YXmlFragment(XmlFragmentRef)
Instance of a XmlFragmentRef.
YXmlText(XmlTextRef)
Instance of a XmlTextRef.
YDoc(Doc)
Subdocument.
UndefinedRef(BranchPtr)
Instance of a shared collection of undefined type. Usually happens when it refers to a root type that has not been defined locally. Can also refer to a [WeakRef] if “weak” feature flag was not set.
Implementations§
Trait Implementations§
Source§impl ToJson for Out
impl ToJson for Out
Source§fn to_json<T: ReadTxn>(&self, txn: &T) -> Any
fn to_json<T: ReadTxn>(&self, txn: &T) -> Any
Converts current value into Any object equivalent that resembles enhanced JSON payload. Rules are:
- Primitive types (Out::Any) are passed right away, as no transformation is needed.
- Out::YArray is converted into JSON-like array.
- Out::YMap is converted into JSON-like object map.
- Out::YText, Out::YXmlText and Out::YXmlElement are converted into strings (XML types are stringified XML representation).
Source§impl TryFrom<Out> for XmlElementRef
impl TryFrom<Out> for XmlElementRef
Source§impl TryFrom<Out> for XmlFragmentRef
impl TryFrom<Out> for XmlFragmentRef
Source§impl TryFrom<Out> for XmlTextRef
impl TryFrom<Out> for XmlTextRef
impl StructuralPartialEq for Out
Auto Trait Implementations§
impl Freeze for Out
impl !RefUnwindSafe for Out
impl Send for Out
impl Sync for Out
impl Unpin for Out
impl UnsafeUnpin for Out
impl !UnwindSafe for Out
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