Skip to main content

Run

Struct Run 

Source
pub struct Run<'t>(pub &'t ModelTable);
Expand description

A value of a type whose table does the work (Model::to_json of an Option, a Collection): the type’s functions as the table runs them.

Tuple Fields§

§0: &'t ModelTable

Implementations§

Source§

impl Run<'_>

Source

pub fn to_json(&self, value: &dyn Any) -> Value

Source

pub fn from_json<T: 'static>(&self, value: &Value) -> Result<T, ModelError>

§Errors

Why value is no JSON form of the type.

Source

pub fn load<T: 'static>( &self, doc: &Doc, value: &Value<'_>, id: &ObjId, ) -> Result<T, ModelError>

Source

pub fn missing<T: 'static>(&self) -> Result<T, ModelError>

Source

pub fn store( &self, value: &dyn Any, doc: &mut Doc, slot: Slot<'_>, ) -> Result<(), ModelError>

Source

pub fn stores_as(&self, value: &dyn Any, before: &dyn Any) -> bool

Source

pub fn store_changed( &self, value: &dyn Any, before: &dyn Any, doc: &mut Doc, slot: Slot<'_>, dirty: &Delta, ) -> Result<(), ModelError>

Source

pub fn refresh( &self, target: &mut dyn Any, doc: &Doc, value: &Value<'_>, id: &ObjId, delta: &Delta, ) -> Result<(), ModelError>

Source

pub fn edit( &self, doc: &mut Doc, slot: Slot<'_>, path: &[Segment], op: &EditOp, cx: &mut ActionCx, ) -> Result<(), ModelError>

Source

pub fn diff<E>( &self, before: &dyn Any, after: &dyn Any, path: &[Segment], out: &mut Vec<Edit<E>>, )

Source

pub fn collect_text(&self, value: &dyn Any, out: &mut Vec<String>)

Source

pub fn check(&self, value: &dyn Any) -> Result<(), Refusal>

Source

pub fn get_at<'a>( &self, value: &'a dyn Any, path: &[Segment], ) -> Option<&'a dyn Any>

Source

pub fn op_coalesces( &self, path: &[Segment], previous: &Value, next: &Value, ) -> Option<bool>

Source

pub fn op_continuable(&self, path: &[Segment], op: &Value) -> Option<bool>

Source

pub fn op_describe(&self, path: &[Segment], op: &Value) -> Option<OpDescription>

Source

pub fn op_lands( &self, value: &dyn Any, path: &[Segment], op: &Value, ) -> Option<Place>

Source

pub fn op_schemas(&self, prefix: &str, out: &mut Vec<(String, Value)>)

Auto Trait Implementations§

§

impl<'t> Forget for Run<'t>

§

impl<'t> Freeze for Run<'t>

§

impl<'t> Move for Run<'t>

§

impl<'t> RefUnwindSafe for Run<'t>

§

impl<'t> Send for Run<'t>

§

impl<'t> Sync for Run<'t>

§

impl<'t> Unpin for Run<'t>

§

impl<'t> UnsafeUnpin for Run<'t>

§

impl<'t> UnwindSafe for Run<'t>

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> Instrument for T

Source§

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

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

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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