pub trait Operations: Model {
type Op: Serialize + DeserializeOwned + JsonSchema;
// Provided methods
fn coalesces(previous: &Self::Op, next: &Self::Op) -> bool { ... }
fn continuable(op: &Self::Op) -> bool { ... }
fn describe(op: &Self::Op) -> OpDescription { ... }
fn lands(&self, op: &Self::Op) -> Option<Place> { ... }
}Expand description
A type with its own vocabulary of edits beside the generic ones: rich
text’s marks and blocks. Its paths offer Path::perform; its Model
impl calls operations_model! so records
holding it route those edits’ gestures, landing places and schema to it.
Required Associated Types§
Sourcetype Op: Serialize + DeserializeOwned + JsonSchema
type Op: Serialize + DeserializeOwned + JsonSchema
One edit of the type, in its own terms.
Provided Methods§
Sourcefn coalesces(previous: &Self::Op, next: &Self::Op) -> bool
fn coalesces(previous: &Self::Op, next: &Self::Op) -> bool
Whether next, straight after previous by the same actor, is the
same gesture (typing on in one word): one undo step.
Sourcefn continuable(op: &Self::Op) -> bool
fn continuable(op: &Self::Op) -> bool
Whether a gesture may go on after op.
Sourcefn describe(op: &Self::Op) -> OpDescription
fn describe(op: &Self::Op) -> OpDescription
What op did, as a history entry records it: the kind of edit and
its plain facts by name ({mark: "strong", words: 3}), which the
reader’s message receives.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".