sparkling/format/registry
Types
Global registry of format handlers
pub opaque type FormatRegistry
Values
pub fn decode(
registry: FormatRegistry,
format_name: String,
data: String,
) -> Result(List(dict.Dict(String, json.Json)), String)
Decode data using the specified format
pub fn default_registry() -> FormatRegistry
Create default registry with all available format handlers Includes: JSONEachRow, TabSeparated, CSV
pub fn encode(
registry: FormatRegistry,
format_name: String,
data: List(dict.Dict(String, json.Json)),
) -> Result(String, String)
Encode data using the specified format
pub fn get_handler(
registry: FormatRegistry,
format_name: String,
) -> option.Option(FormatHandler)
Get a format handler by name
pub fn list_formats(registry: FormatRegistry) -> List(String)
List all registered format names
pub fn register(
registry: FormatRegistry,
handler: FormatHandler,
) -> FormatRegistry
Register a format handler