Enum Out
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§
§impl ToJson for Out
impl ToJson for Out
§fn to_json<T>(&self, txn: &T) -> Anywhere
T: ReadTxn,
fn to_json<T>(&self, txn: &T) -> Anywhere
T: ReadTxn,
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).
§impl TryFrom<Out> for XmlElementRef
impl TryFrom<Out> for XmlElementRef
§impl TryFrom<Out> for XmlFragmentRef
impl TryFrom<Out> for XmlFragmentRef
§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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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.