import Base type Config is Data: Host{host: String, port: U32, user: String, pass: String, vhost: String, prefetch: U32} type Subscription is Data: Sub{queue: String, dlq_exchange: String, dlq_routing_key: String} type Delivery is Data: Msg{body: String, tag: Nat, queue: String} def Config.host(+cfg: Config) -> String: match cfg: case Host{host, port, user, pass, vhost, prefetch}: host def Config.port(+cfg: Config) -> U32: match cfg: case Host{host, port, user, pass, vhost, prefetch}: port def Config.user(+cfg: Config) -> String: match cfg: case Host{host, port, user, pass, vhost, prefetch}: user def Config.pass(+cfg: Config) -> String: match cfg: case Host{host, port, user, pass, vhost, prefetch}: pass def Config.vhost(+cfg: Config) -> String: match cfg: case Host{host, port, user, pass, vhost, prefetch}: vhost def Config.prefetch(+cfg: Config) -> U32: match cfg: case Host{host, port, user, pass, vhost, prefetch}: prefetch