diff options
| author | Fuwn <[email protected]> | 2021-05-20 17:05:59 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-20 17:05:59 +0000 |
| commit | 9dbc613765de8ab7dfa8e1374cf6661dcfd56bc8 (patch) | |
| tree | 8cfff6a23bb72db2660e68c63a8cf9d0539a061f /crates/whirl_server/src/cmd/extendable.rs | |
| parent | feat(readme): add sqlfluff as a dev dep (diff) | |
| download | whirl-9dbc613765de8ab7dfa8e1374cf6661dcfd56bc8.tar.xz whirl-9dbc613765de8ab7dfa8e1374cf6661dcfd56bc8.zip | |
refactor(global): move crates around, stricter module isolation
Diffstat (limited to 'crates/whirl_server/src/cmd/extendable.rs')
| -rw-r--r-- | crates/whirl_server/src/cmd/extendable.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/whirl_server/src/cmd/extendable.rs b/crates/whirl_server/src/cmd/extendable.rs new file mode 100644 index 0000000..e6f3c2b --- /dev/null +++ b/crates/whirl_server/src/cmd/extendable.rs @@ -0,0 +1,18 @@ +// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective +// SPDX-License-Identifier: GPL-3.0-only + +pub trait Parsable { + fn parse(data: Vec<u8>) -> Self; +} + +pub trait Creatable { + fn create(self) -> Vec<u8>; +} + +/// Having to do this makes me with there was operator overloading in Rust. +/// +/// I *could* do this with a macro but since Text is the only struct that +/// implements this trait, it shouldn't be that big of a deal. +pub trait ParsableWithArguments { + fn parse(data: Vec<u8>, args: &[&str]) -> Self; +} |