pub struct EditorSession {
pub graph: DependencyGraph,
/* private fields */
}Expand description
High-level editing session that owns a graph and optional change tracking.
Fields§
§graph: DependencyGraphImplementations§
Source§impl EditorSession
impl EditorSession
pub fn new_with_graph(graph: DependencyGraph, cfg: IoConfig) -> Self
pub fn new(cfg: IoConfig) -> Self
Sourcepub fn begin_action(&mut self, description: impl Into<String>)
pub fn begin_action(&mut self, description: impl Into<String>)
Begin a user-visible action; opens a compound group when enabled.
Sourcepub fn end_action(&mut self)
pub fn end_action(&mut self)
End the current user-visible action; closes group when enabled.
Sourcepub fn with_action<F, R>(
&mut self,
description: impl Into<String>,
f: F,
) -> Result<R, EditorError>
pub fn with_action<F, R>( &mut self, description: impl Into<String>, f: F, ) -> Result<R, EditorError>
Helper to run an action with automatic begin/end.
Sourcepub fn make_editor(&mut self) -> VertexEditor<'_>
pub fn make_editor(&mut self) -> VertexEditor<'_>
Get a VertexEditor wired appropriately (with or without logger).
Sourcepub fn undo(&mut self) -> Result<(), EditorError>
pub fn undo(&mut self) -> Result<(), EditorError>
Undo last compound group if enabled. No-op otherwise.
Sourcepub fn redo(&mut self) -> Result<(), EditorError>
pub fn redo(&mut self) -> Result<(), EditorError>
Redo last undone group if enabled. No-op otherwise.
Sourcepub fn commit_with_rollback<F>(&mut self, persist: F) -> Result<(), IoError>
pub fn commit_with_rollback<F>(&mut self, persist: F) -> Result<(), IoError>
Commit using a persistence callback. On error, roll back last group when enabled.
Sourcepub fn changelog_enabled(&self) -> bool
pub fn changelog_enabled(&self) -> bool
Access to ChangeLog for inspection; None when disabled.
Auto Trait Implementations§
impl Freeze for EditorSession
impl RefUnwindSafe for EditorSession
impl Send for EditorSession
impl Sync for EditorSession
impl Unpin for EditorSession
impl UnwindSafe for EditorSession
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
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 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>
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