InMemoryReplResultsHolder

Interface for classes that can store in-memory results from the REPL.

This is only relevant for a kernel running in embedded mode, but here it allows the frontend to directly access REPL results without having to serialize them to JSON first.

Each instance should be bound to a single jupyter session, and all ids used should be unique within that session. Generally DisplayResult.id should suffice.

From the view of the InMemoryReplResultsHolder, all values are opaque values, the user of this interface should know what type it is.

Inheritors

Properties

Link copied to clipboard
abstract val size: Int

Returns how many REPL results are currently being stored.

Functions

Link copied to clipboard
abstract fun addReplResult(result: Any?): String

Add a REPL result without an ID. An ID will be auto-generated and returned.

Link copied to clipboard
abstract fun getReplResult(id: String): Any?

Returns the REPL result for a given id or null if no result exists or null was the result.

Link copied to clipboard
abstract fun removeReplResult(id: String): Boolean

Removes the REPL result with the given id from the holder. Returns true if an entry was removed, false if not.

Link copied to clipboard
abstract fun setReplResult(id: String, result: Any?)

Sets the REPL result for a given id.