moonbit-community/proton/extension does not have a README file

EventWakeup

The opaque native callback supplied to an extension event source.

ExtensionAdapterError

pub(all) suberror ExtensionAdapterError {
TypedSpecInvalid(extension_id~ : String, detail~ : String)
} derive(
Debug
)

Failures while adapting a framework extension to the app command runtime.

ExtensionAdapterError::message

fn ExtensionAdapterError::message(self : ExtensionAdapterError) -> String

ExtensionAdapterError::output

fn ExtensionAdapterError::output(self : ExtensionAdapterError, logger : &Logger) -> Unit

ExtensionAdapterError::to_string

fn ExtensionAdapterError::to_string(self : ExtensionAdapterError) -> String

Event

pub struct Event {
extension_id : String
extension_namespace : String
name : String
payload : Json
}

One event produced by an extension-owned native event source.

EventSource

pub struct EventSource {
start : (
EventWakeup
) -> Unit raise
stop : () -> Unit
drain : () -> Array[Event] raise
}

A native event source integrated with Proton's host event loop.

start installs an opaque native wakeup before the source begins producing events. Native callbacks enqueue their payload and invoke that wakeup; Proton later calls drain on the runtime owner thread. stop must be idempotent and wait until the source can no longer invoke the wakeup.

Extension

type Extension

Extension::id

fn Extension::id(self : Extension) -> String

RendererCapability

pub struct RendererCapability {
extension : Extension
scope : Json
}

A typed extension capability that can be granted to a renderer.

Extension packages build this value after validating their public scope types. Applications pass it to App::capability without handling extension identifiers or raw permission JSON.

capability

fn capability(extension : Extension, scope? : Json) -> RendererCapability

Builds a renderer capability from an extension definition and its validated internal scope.

This constructor is intended for extension authors. Application-facing extension packages should expose a typed capability function instead.

event

Encodes a typed extension event for delivery to renderer subscribers.

event_source

fn event_source(start : (
EventWakeup
) -> Unit raise, stop : () -> Unit, drain : () -> Array[Event] raise) -> EventSource

Defines a wake-driven event source with explicit teardown.

typed

Builds an installable extension from typed command descriptors.

Validation is deferred until application configuration so invalid static extension metadata follows the facade's ordinary adaptation error path.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io