~/bend-docscommunity

types.bend source

types.bend on the hub · documented module

import Basetype 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}:      hostdef Config.port(+cfg: Config) -> U32:  match cfg:    case Host{host, port, user, pass, vhost, prefetch}:      portdef Config.user(+cfg: Config) -> String:  match cfg:    case Host{host, port, user, pass, vhost, prefetch}:      userdef Config.pass(+cfg: Config) -> String:  match cfg:    case Host{host, port, user, pass, vhost, prefetch}:      passdef Config.vhost(+cfg: Config) -> String:  match cfg:    case Host{host, port, user, pass, vhost, prefetch}:      vhostdef Config.prefetch(+cfg: Config) -> U32:  match cfg:    case Host{host, port, user, pass, vhost, prefetch}:      prefetch