aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/scanners/concepts.cppm
diff options
context:
space:
mode:
Diffstat (limited to 'ttwhy/scanners/concepts.cppm')
-rw-r--r--ttwhy/scanners/concepts.cppm18
1 files changed, 18 insertions, 0 deletions
diff --git a/ttwhy/scanners/concepts.cppm b/ttwhy/scanners/concepts.cppm
new file mode 100644
index 0000000..003874c
--- /dev/null
+++ b/ttwhy/scanners/concepts.cppm
@@ -0,0 +1,18 @@
+module;
+
+#include <concepts>
+#include <span>
+
+export module ttwhy.scanners:concepts;
+
+namespace ttwhy
+{
+
+ export template<typename Candidate>
+ concept scanner = requires(Candidate a, std::span<char const> buffer) {
+ { a.process(buffer) } -> std::same_as<void>;
+ { a.timeout() } -> std::same_as<void>;
+ { a.is_pending() } -> std::same_as<bool>;
+ };
+
+} // namespace ttwhy