InMemoryMimeTypedResult

class InMemoryMimeTypedResult(val inMemoryOutput: InMemoryResult, val fallbackResult: Map<String, JsonElement>) : DisplayResult

Wrapper for DisplayResults that contain in memory results. This is only applicable to the embedded server.

Parameters

inMemoryOutput

the in-memory result + its mime-type that tells the client how to render it.

fallbackResult

fallback output the client can use as a placeholder for the in-memory result, if it is no longer available. Like when saving the notebook to disk.

Constructors

Link copied to clipboard
constructor(inMemoryOutput: InMemoryResult, fallbackResult: Map<String, JsonElement>)

Properties

Link copied to clipboard
val fallbackResult: Map<String, JsonElement>
Link copied to clipboard
open val id: String?

Unique id that may be used for updating display data

Link copied to clipboard

Functions

Link copied to clipboard
open override fun render(notebook: Notebook): DisplayResult

Renders display result, generally should return this

Link copied to clipboard
open fun toJson(additionalMetadata: JsonObject = Json.EMPTY): JsonObject

open override fun toJson(additionalMetadata: JsonObject, overrideId: String?): JsonObject

Converts display data to JSON object for display_data response

Link copied to clipboard
fun DisplayResult?.toJson(): JsonObject

Convenience method for converting nullable DisplayResult to JSON

Link copied to clipboard