Struct yrs::types::map::MapPrelim

source ·
pub struct MapPrelim<T>(/* private fields */);
Expand description

A preliminary map. It can be used to early initialize the contents of a Map, when it’s about to be inserted into another Yrs collection, such as Array or another Map.

Implementations§

source§

impl<T> MapPrelim<T>

source

pub fn new() -> Self

Trait Implementations§

source§

impl<K, V, const N: usize> From<[(K, V); N]> for MapPrelim<V>
where K: Into<String>, V: Prelim,

source§

fn from(arr: [(K, V); N]) -> Self

Converts to this type from the input type.
source§

impl<T> From<HashMap<String, T>> for MapPrelim<T>

source§

fn from(map: HashMap<String, T>) -> Self

Converts to this type from the input type.
source§

impl<T: Prelim> Into<EmbedPrelim<MapPrelim<T>>> for MapPrelim<T>

source§

fn into(self) -> EmbedPrelim<MapPrelim<T>>

Converts this type into the (usually inferred) input type.
source§

impl<T: Prelim> Prelim for MapPrelim<T>

§

type Return = MapRef

Type of a value to be returned as a result of inserting this Prelim type instance. Use Unused if none is necessary.
source§

fn into_content( self, _txn: &mut TransactionMut<'_> ) -> (ItemContent, Option<Self>)

This method is used to create initial content required in order to create a block item. A supplied ptr can be used to identify block that is about to be created to store the returned content. Read more
source§

fn integrate(self, txn: &mut TransactionMut<'_>, inner_ref: BranchPtr)

Method called once an original item filled with content from Self::into_content has been added to block store. This method is used by complex types such as maps or arrays to append the original contents of prelim struct into YMap, YArray etc.

Auto Trait Implementations§

§

impl<T> Freeze for MapPrelim<T>

§

impl<T> RefUnwindSafe for MapPrelim<T>
where T: RefUnwindSafe,

§

impl<T> Send for MapPrelim<T>
where T: Send,

§

impl<T> Sync for MapPrelim<T>
where T: Sync,

§

impl<T> Unpin for MapPrelim<T>
where T: Unpin,

§

impl<T> UnwindSafe for MapPrelim<T>
where T: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.