module; #include #include #include export module ttwhy.core:concepts; namespace ttwhy { //! Validates that a candidate type implements the byte scanner interface. //! //! @tparam Candidate The type to validate. export template concept scanner = requires(Candidate a, std::span buffer) { { a.process(buffer) } -> std::same_as; { a.timeout() } -> std::same_as; { a.is_pending() } -> std::same_as; }; //! Validates that a candidate type implements an asynchronous event router interface. //! //! @tparam Candidate The type to validate. //! @tparam Event The type of the event to process. export template concept router = requires(Candidate candidate, Event event) { { candidate.process(event) } -> std::same_as>; }; //! Validates that a sink type can receive an event of the given type. //! //! @tparam Sink The sink callable type. //! @tparam Event The type of the event to deliver. export template concept event_sink = requires(Sink sink, Event event) { { sink(event) } -> std::same_as; }; } // namespace ttwhy