Camber.choice: def of bend-kit-camber@0.15.0.1 Import: import bend-kit-camber@0.15.0.1/camber.bend as Camber Lines 856-878 of bend-kit-camber@0.15.0.1/camber.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-camber@0.15.0.1/camber.bend&start_line=856&end_line=878 import Base import bend-kit-http@0.38.1.1/http.bend as Http import bend-kit-router@0.2.0.0/router.bend as Router import bend-kit-router@0.2.0.0/target.bend as Target def choice(~A: Data, ~S: Type, ~K: Data, ~E: Data, ~H: Data, ~before_hook: H -> S -> K -> Metadata -> IO(Step), ~after_hook: H -> S -> K -> Http.Res -> IO(S & Result<&2, &1, Error, Http.Res>), ~run: A -> S -> K -> Match> -> Http.Req -> IO(S & Result<&2, &1, Error, Http.Res>), ~mapper: S -> K -> Error -> IO(S & Result<&2, &1, Error, Http.Res>), selected: Router.Choice>>, target: Target.Target, groups: List<&2, GroupPlan>>, state: S, +config: K, +meta: Metadata, entered: List<&2, Policy>, body: Http.Body ) -> IO(Completion): match selected: case Router.NotFound{}: framework(~S, ~K, ~E, ~H, ~mapper, 404, "", state, config, entered, body) case Router.MethodMissing{ids, allow}: policies = groups.prepared(~Policy, groups, ids) scopes(~S, ~K, ~E, ~H, ~before_hook, ~after_hook, ~mapper, policies, state, config, meta, entered, body, s => entered => b => framework(~S, ~K, ~E, ~H, ~mapper, 405, allow, s, config, entered, b)) case Router.Options{ids, allow}: policies = groups.prepared(~Policy, groups, ids) scopes(~S, ~K, ~E, ~H, ~before_hook, ~after_hook, ~mapper, policies, state, config, meta, entered, body, s => entered => b => framework(~S, ~K, ~E, ~H, ~mapper, 204, allow, s, config, entered, b)) case Router.Found{Endpoint{action, +policies}, params, ids, method, pattern}: selected = {Match{target, params, ids, method, pattern, policies} : Match>} scopes(~S, ~K, ~E, ~H, ~before_hook, ~after_hook, ~mapper, policies.tail(~H, policies), state, config, meta, entered, body, s => entered => b => endpoint(~A, ~S, ~K, ~E, ~H, ~run, ~mapper, action, s, config, selected, meta, entered, b)) Uses (22): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Completion https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Endpoint https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=GroupPlan https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Match https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Metadata https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Policy https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=Step https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=endpoint https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=framework https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=groups.prepared https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=policies.tail https://jend.leeeet.dev/definition.txt?path=bend-kit-camber@0.15.0.1/camber.bend&name=scopes https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Body https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Req https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Res https://jend.leeeet.dev/definition.txt?path=bend-kit-router@0.2.0.0/router.bend&name=Choice https://jend.leeeet.dev/definition.txt?path=bend-kit-router@0.2.0.0/target.bend&name=Target