Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

Out

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§

§

impl Out

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

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.

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

Converts current value into stringified representation.

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

Trait Implementations§

§

impl AsPrelim for Out

§

type Prelim = In

§

fn as_prelim<T>(&self, txn: &T) -> <Out as AsPrelim>::Prelim
where T: ReadTxn,

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

impl Clone for Out

§

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
§

impl Debug for Out

§

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

Formats the value using the given formatter. Read more
§

impl Default for Out

§

fn default() -> Out

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

impl Display for Out

§

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

Formats the value using the given formatter. Read more
§

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

§

fn from(v: T) -> Out

Converts to this type from the input type.
§

impl From<XmlOut> for Out

§

fn from(value: XmlOut) -> Out

Converts to this type from the input type.
§

impl Into<Out> for BranchPtr

§

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.

§

impl PartialEq for Out

§

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

impl ToJson for Out

§

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

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

§

impl TryFrom<ItemPtr> for Out

§

type Error = ItemPtr

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

fn try_from(value: ItemPtr) -> Result<Out, <Out as TryFrom<ItemPtr>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for Arc<[u8]>

§

type Error = Out

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

fn try_from(value: Out) -> Result<Arc<[u8]>, <Arc<[u8]> as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for Arc<str>

§

type Error = Out

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

fn try_from(value: Out) -> Result<Arc<str>, <Arc<str> as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for ArrayRef

§

type Error = Out

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

fn try_from(value: Out) -> Result<ArrayRef, <ArrayRef as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for Doc

§

type Error = Out

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

fn try_from(value: Out) -> Result<Doc, <Doc as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for MapRef

§

type Error = Out

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

fn try_from(value: Out) -> Result<MapRef, <MapRef as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for String

§

type Error = Out

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

fn try_from(value: Out) -> Result<String, <String as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for TextRef

§

type Error = Out

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

fn try_from(value: Out) -> Result<TextRef, <TextRef as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for Vec<u8>

§

type Error = Out

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

fn try_from(value: Out) -> Result<Vec<u8>, <Vec<u8> as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for XmlElementRef

§

type Error = Out

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

fn try_from( value: Out, ) -> Result<XmlElementRef, <XmlElementRef as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for XmlFragmentRef

§

type Error = Out

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

fn try_from( value: Out, ) -> Result<XmlFragmentRef, <XmlFragmentRef as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for XmlOut

§

type Error = Out

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

fn try_from(value: Out) -> Result<XmlOut, <XmlOut as TryFrom<Out>>::Error>

Performs the conversion.
§

impl TryFrom<Out> for XmlTextRef

§

type Error = Out

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

fn try_from( value: Out, ) -> Result<XmlTextRef, <XmlTextRef as TryFrom<Out>>::Error>

Performs the conversion.
§

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

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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