Module Uri_parsing.Versioned_parserSource

include Uri_parser_intf
Sourcetype 'a t
Sourceval check_ok_and_print_urls_or_errors : 'a t -> unit

You should have an expect test with this just below your routes definition, so that you can see what your URL scheme looks like, and/or any errors.

Runs static checks, and shows all of the url shapes that the parser can parse. It lets you know if a URL shape sneakily changes or if there is any ambiguity in your parser. It tries its best to suggest possible fixes too.

Sourceval eval : ?encoding_behavior:Percent_encoding_behavior.t -> 'a t -> (Components.t, 'a Parse_result.t) Projection.t

"Evaluates" a 'a t into a projection that parses to/from Components.t to 'a Parse_result.t.

Sourceval eval_for_uri : ?encoding_behavior:Percent_encoding_behavior.t -> 'a t -> (Uri.t, 'a Parse_result.t) Projection.t

Like eval but parses/unparses from/into a Uri.t

Sourceval all_urls : 'a t -> string list

Returns a list of the shapes of all the URLs given that the parser can parse.

Sourceval to_string : 'a t -> ('a -> string) Core.Staged.t

Creates a URL that you can attach to an a tag as an href to reference another URL from your site. The function is staged because it "evaluates" the parser which _could_ be an expensive operation.

Sourceval of_non_typed_parser : (Components.t, 'a) Projection.t -> 'a t

Are you migrating your site to use Url_var's Typed API and you don't want to break your existing links? Use of_non_typed_parser instead of first_parser.

Sourceval first_parser : 'a Parser.t -> 'a t

Your site's first URL. Analogous to a list with one element.

Sourceval new_parser : 'new_ Parser.t -> previous:'prev t -> f:('prev -> 'new_) -> 'new_ t

Need to change your URL? Use new_parser to "fallback" to previous if the new parser can't recognize a URL. If previous success and parses into result, then f result will be returned. Analogous to cons in a list.