pub enum UndoableOperation {
Show 14 variants
InsertCell {
cell_name: String,
after_cell_name: Option<String>,
},
DeleteCell {
cell_name: String,
source: String,
after_cell_name: Option<String>,
},
DuplicateCell {
original_cell_name: String,
new_cell_name: String,
},
MoveCell {
cell_name: String,
direction: MoveDirection,
},
RenameCell {
cell_name: String,
old_display_name: String,
new_display_name: String,
},
EditCell {
cell_id: CellId,
start_line: usize,
end_line: usize,
old_source: String,
new_source: String,
},
InsertMarkdownCell {
start_line: usize,
end_line: usize,
content: String,
},
EditMarkdownCell {
start_line: usize,
end_line: usize,
old_content: String,
new_content: String,
is_module_doc: bool,
},
DeleteMarkdownCell {
start_line: usize,
content: String,
},
MoveMarkdownCell {
start_line: usize,
end_line: usize,
direction: MoveDirection,
},
InsertDefinitionCell {
start_line: usize,
end_line: usize,
content: String,
definition_type: DefinitionType,
},
EditDefinitionCell {
cell_id: CellId,
start_line: usize,
end_line: usize,
old_content: String,
new_content: String,
},
DeleteDefinitionCell {
start_line: usize,
end_line: usize,
content: String,
definition_type: DefinitionType,
},
MoveDefinitionCell {
start_line: usize,
end_line: usize,
direction: MoveDirection,
},
}Expand description
An undoable operation on the notebook.
Variants§
InsertCell
A cell was inserted. Undo = delete this cell.
Fields
DeleteCell
A cell was deleted. Undo = restore it.
Fields
DuplicateCell
A cell was duplicated. Undo = delete the new cell.
Fields
MoveCell
A cell was moved. Undo = move in opposite direction.
Fields
direction: MoveDirectionOriginal direction (undo reverses it).
RenameCell
A cell’s display name was renamed. Undo = restore old name.
Fields
EditCell
A code cell was edited. Undo = restore old source.
Fields
InsertMarkdownCell
A markdown cell was inserted. Undo = delete it.
Fields
EditMarkdownCell
A markdown cell was edited. Undo = restore old content.
Fields
DeleteMarkdownCell
A markdown cell was deleted. Undo = restore it.
Fields
MoveMarkdownCell
A markdown cell was moved. Undo = move in opposite direction.
Fields
direction: MoveDirectionDirection it was moved.
InsertDefinitionCell
A definition cell was inserted. Undo = delete it.
Fields
definition_type: DefinitionTypeType of definition.
EditDefinitionCell
A definition cell was edited. Undo = restore old content.
Fields
DeleteDefinitionCell
A definition cell was deleted. Undo = restore it.
Fields
definition_type: DefinitionTypeType of definition.
MoveDefinitionCell
A definition cell was moved. Undo = move in opposite direction.
Implementations§
Source§impl UndoableOperation
impl UndoableOperation
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get a human-readable description of this operation.
Sourcepub fn undo_description(&self) -> String
pub fn undo_description(&self) -> String
Get the reverse operation (what undo would do).
Trait Implementations§
Source§impl Clone for UndoableOperation
impl Clone for UndoableOperation
Source§fn clone(&self) -> UndoableOperation
fn clone(&self) -> UndoableOperation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for UndoableOperation
impl RefUnwindSafe for UndoableOperation
impl Send for UndoableOperation
impl Sync for UndoableOperation
impl Unpin for UndoableOperation
impl UnwindSafe for UndoableOperation
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.