pub struct NotebookRuntime { /* private fields */ }Expand description
Notebook runtime with reactive cell execution.
Implementations§
Source§impl NotebookRuntime
impl NotebookRuntime
Sourcepub fn add_cell(&mut self, source: impl Into<String>) -> CellId
pub fn add_cell(&mut self, source: impl Into<String>) -> CellId
Add a new cell to the notebook.
Sourcepub fn update_cell(
&mut self,
id: CellId,
source: impl Into<String>,
) -> HashSet<CellId>
pub fn update_cell( &mut self, id: CellId, source: impl Into<String>, ) -> HashSet<CellId>
Update a cell’s source code.
Returns the set of cells that need re-execution.
Sourcepub fn remove_cell(&mut self, id: CellId) -> Option<Cell>
pub fn remove_cell(&mut self, id: CellId) -> Option<Cell>
Remove a cell from the notebook.
Sourcepub fn cells_in_order(&self) -> Vec<CellId> ⓘ
pub fn cells_in_order(&self) -> Vec<CellId> ⓘ
Get cells in execution order.
Sourcepub fn dirty_cells(&self) -> Vec<CellId> ⓘ
pub fn dirty_cells(&self) -> Vec<CellId> ⓘ
Get cells that need execution.
Sourcepub fn execute_cell(&mut self, id: CellId) -> Option<&CellOutput>
pub fn execute_cell(&mut self, id: CellId) -> Option<&CellOutput>
Execute a single cell.
This is a stub - the actual execution would be done by the Ruchy runtime.
Sourcepub fn execute_dirty(&mut self) -> Vec<(CellId, CellOutput)>
pub fn execute_dirty(&mut self) -> Vec<(CellId, CellOutput)>
Execute all dirty cells in dependency order.
Sourcepub fn execute_all(&mut self) -> Vec<(CellId, CellOutput)>
pub fn execute_all(&mut self) -> Vec<(CellId, CellOutput)>
Execute all cells in dependency order.
Sourcepub fn clear_namespace(&mut self)
pub fn clear_namespace(&mut self)
Clear the namespace.
Trait Implementations§
Source§impl Debug for NotebookRuntime
impl Debug for NotebookRuntime
Source§impl Default for NotebookRuntime
impl Default for NotebookRuntime
Source§fn default() -> NotebookRuntime
fn default() -> NotebookRuntime
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NotebookRuntime
impl RefUnwindSafe for NotebookRuntime
impl Send for NotebookRuntime
impl Sync for NotebookRuntime
impl Unpin for NotebookRuntime
impl UnsafeUnpin for NotebookRuntime
impl UnwindSafe for NotebookRuntime
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