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/commands/action.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/commands/action.rs')
| -rw-r--r-- | crates/whirl_server/src/cmd/commands/action.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/whirl_server/src/cmd/commands/action.rs b/crates/whirl_server/src/cmd/commands/action.rs new file mode 100644 index 0000000..8d1fb0b --- /dev/null +++ b/crates/whirl_server/src/cmd/commands/action.rs @@ -0,0 +1,26 @@ +// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective +// SPDX-License-Identifier: GPL-3.0-only + +// TODO: of2m-ify +// +// Of2m-ifying isn't much of a priority right now as the whole action ordeal +// hasn't been fully dissected yet. Once more is known about the inner working +// of actions, it will be of2m-ified. + +use bytes::{BufMut, BytesMut}; + +pub fn create_action() -> Vec<u8> { + let mut command = BytesMut::new(); + + command.put_slice(&[ + 0x01, 0x11, 0x00, 0x05, 0x54, 0x52, 0x41, 0x44, 0x45, 0x07, 0x26, 0x7c, 0x2b, 0x69, 0x6e, 0x76, + 0x3e, + ]); + + // Convert to vector and insert the length + let mut command_as_vec = command.to_vec(); + command_as_vec.insert(0, command.len() as u8 + 1); + + // Return bytes + command_as_vec +} |