pub struct Program {
    pub filename: String,
    pub workspace: String,
    pub cells: HashMap<u32, Cell>,
}
Expand description

This is what sits in state as long as the program is running when a new request is made, it will check if the same cell has been executed by checking cells which is a HashMap

Terms

  • temp_dir: Whatever the OS temp directory is
  • filename: Last executed filename so we can restart state if necessary
  • cells: VS Code name for a notebook cell

Fields

filename: Stringworkspace: Stringcells: HashMap<u32, Cell>

Implementations

Create a new program which is retained in state between http requests

Initial cell creation if it doesn’t exist yet Contents Use clone as we need to retain a pointer to data that will stick around after the request has finished

As the cells are implemented with a HashMap this is a fast lookup, Only updates what’s required

First sorts the hashmap by index into a vector, then writes the output with ultnote-start and ultnote-end to determine which cell’s was executing

Run the program by running cargo run in the temp directory then uses regex to determine what part of the output to send back to the caller

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.