module; #include #include export module routemon:http.common; namespace beast = boost::beast; export namespace bhttp = beast::http; namespace boost::beast { namespace concepts { template concept buffers_generator = beast::is_buffers_generator::value; template concept const_buffer_sequence = beast::is_const_buffer_sequence::value; } // namespace concepts namespace http::concepts { template concept fields = is_fields::value; template concept body = is_body::value; template concept body_reader = is_body_reader::value; } // namespace http::concepts } // namespace boost::beast namespace routemon::http { struct supported_verb { enum supported_verb_t : std::uint8_t { options, delete_, get, head, post, put, }; supported_verb_t value; supported_verb(supported_verb_t value); static auto from(bhttp::verb v) -> std::optional; operator bhttp::verb() const; }; export struct verb_set { bool options : 1 = false; bool delete_ : 1 = false; bool get : 1 = false; bool head : 1 = false; bool post : 1 = false; bool put : 1 = false; [[nodiscard]] auto with(supported_verb v) const noexcept -> verb_set; [[nodiscard]] auto empty() const noexcept -> bool; [[nodiscard]] auto to_string() const -> std::string; auto operator==(verb_set const& rhs) const noexcept -> bool = default; }; static_assert(sizeof(verb_set) == 1); static_assert(alignof(verb_set) == 1); } // namespace routemon::http