Module service

Module service 

Source
Expand description

Service dispatcher: routes web/RPC calls to backend services. Port of Go’s pkg/service/service.go and all sub-services.

Replaces Go’s reflection-based dispatch with a match-based router. Each service method is a typed function; argument conversion from serde_json::Value is handled at the boundary.

Structs§

CloseTabRtnType
Return type from workspace CloseTab. Matches Go’s workspaceservice.CloseTabRtnType.
MethodMeta
Metadata about a service method. Matches Go’s tsgenmeta.MethodMeta. Used for TypeScript code generation and documentation.
UIContext
UI context passed with service calls. Matches Go’s obj.UIContext.
WebCallType
Incoming service call from the frontend. Matches Go’s service.WebCallType.
WebReturnType
Service call response. Matches Go’s service.WebReturnType.

Constants§

SERVICES
List of available services. Matches Go’s ServiceMap keys.

Functions§

get_arg
Extract a typed argument from the args array.
get_method_meta
Registry of service method metadata (built at startup).
get_optional_arg
Extract an optional typed argument from the args array. Returns Ok(None) if the index is out of bounds or the value is null.
is_valid_service
Check if a service name is valid.