gleam-spacetraders-models/src/spacetraders_models/scanned_ship_frame.gleam
Lily Rose fab4c9df5d
Some checks are pending
test / test (push) Waiting to run
Initial commit
2025-07-08 23:03:42 +10:00

11 lines
331 B
Gleam

import gleam/dynamic/decode.{type Decoder}
import spacetraders_models/frame_symbol.{type FrameSymbol}
pub type ScannedShipFrame {
ScannedShipFrame(symbol: FrameSymbol)
}
pub fn decoder() -> Decoder(ScannedShipFrame) {
use symbol <- decode.field("symbol", frame_symbol.decoder())
decode.success(ScannedShipFrame(symbol:))
}