Skip to main content

Out

Enum Out 

Source
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§

Source§

impl Out

Source

pub fn cast<T>(self) -> Result<T, Self>
where T: TryFrom<Self, Error = Self>,

Attempts to convert current Out value directly onto a different type, as along as it implements TryFrom trait. If conversion is not possible, the original value is returned.

Source

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

Converts current value into stringified representation.

Source

pub fn try_branch(&self) -> Option<&Branch>

Trait Implementations§

Source§

impl AsPrelim for Out

Source§

type Prelim = In

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 Clone for Out

Source§

fn clone(&self) -> Out

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 Out

Source§

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

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

impl Default for Out

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Out

Source§

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

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

impl<T> From<T> for Out
where T: Into<Any>,

Source§

fn from(v: T) -> Self

Converts to this type from the input type.
Source§

impl From<XmlOut> for Out

Source§

fn from(value: XmlOut) -> Self

Converts to this type from the input type.
Source§

impl Into<Out> for BranchPtr

Source§

fn into(self) -> Out

Converts current branch data into a Out. It uses a type ref information to resolve, which value variant is a correct one for this branch. Since branch represent only complex types Out::Any will never be returned from this method.

Source§

impl PartialEq for Out

Source§

fn eq(&self, other: &Out) -> 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 ToJson for Out

Source§

fn to_json<T: ReadTxn>(&self, txn: &T) -> Any

Converts current value into Any object equivalent that resembles enhanced JSON payload. Rules are:

Source§

impl TryFrom<ItemPtr> for Out

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 Arc<[u8]>

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 TryFrom<Out> for Arc<str>

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 TryFrom<Out> for ArrayRef

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 TryFrom<Out> for Doc

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 TryFrom<Out> for MapRef

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 TryFrom<Out> for String

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 TryFrom<Out> for TextRef

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 TryFrom<Out> for Vec<u8>

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 TryFrom<Out> for XmlElementRef

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 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 TryFrom<Out> for XmlOut

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 TryFrom<Out> for XmlTextRef

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 TryFrom<Out> for bool

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 TryFrom<Out> for f32

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 TryFrom<Out> for f64

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 TryFrom<Out> for i16

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 TryFrom<Out> for i32

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 TryFrom<Out> for i64

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 TryFrom<Out> for isize

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 TryFrom<Out> for u16

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 TryFrom<Out> for u32

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 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> 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<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> ToString for T
where T: Display + ?Sized,

Source§

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

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

impl<M> Meta for M
where M: Default,