pub struct Transaction { /* private fields */ }Expand description
In-memory plan bound to one notebook. Drop discards; no begin/rollback.
Implementations§
Source§impl Transaction
impl Transaction
pub fn add_note( &mut self, path: &str, title: Option<&str>, content: &str, tags: &[String], ) -> Result<(), NbError>
pub fn add_todo( &mut self, path: &str, title: &str, description: Option<&str>, tasks: &[String], tags: &[String], ) -> Result<(), NbError>
pub fn add_bookmark( &mut self, path: &str, url: &str, title: Option<&str>, tags: &[String], comment: Option<&str>, ) -> Result<(), NbError>
pub fn add_folder(&mut self, path: &str) -> Result<(), NbError>
pub fn delete_note(&mut self, target: NoteTarget) -> Result<(), NbError>
pub fn move_note( &mut self, target: NoteTarget, destination: &str, ) -> Result<(), NbError>
pub fn mark_task_done( &mut self, target: NoteTarget, task_number: Option<u32>, ) -> Result<(), NbError>
pub fn unmark_task_done( &mut self, target: NoteTarget, task_number: Option<u32>, ) -> Result<(), NbError>
pub fn replace_note_body( &mut self, target: NoteTarget, new_body: &str, fingerprint: Fingerprint, ) -> Result<(), NbError>
pub fn edit_note_substring( &mut self, target: NoteTarget, pattern: &str, replacement: &str, occurrence: Occurrence, expected_count: u32, fingerprint: Option<Fingerprint>, ) -> Result<(), NbError>
pub fn edit_note_lines( &mut self, target: NoteTarget, edits: Vec<LineEdit>, ) -> Result<(), NbError>
pub fn retitle_note( &mut self, target: NoteTarget, title: &str, ) -> Result<(), NbError>
Sourcepub async fn commit(self) -> Result<CommitOutcome, NbError>
pub async fn commit(self) -> Result<CommitOutcome, NbError>
Validate-all, apply-all, at most one Git checkpoint.
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
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
Mutably borrows from an owned value. Read more