aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_server/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-23 13:51:20 +0000
committerFuwn <[email protected]>2021-05-23 13:51:20 +0000
commit59cd17d4b5b1eff2847a954012eb916db4ef5116 (patch)
tree4074d9935949a48c64fdaa8503ae9ddc61e7678e /crates/whirl_server/src
parentbuild(cargo): create a fast builds configuration for cargo (diff)
downloadwhirl-59cd17d4b5b1eff2847a954012eb916db4ef5116.tar.xz
whirl-59cd17d4b5b1eff2847a954012eb916db4ef5116.zip
docs(global): add new documentation
Diffstat (limited to 'crates/whirl_server/src')
-rw-r--r--crates/whirl_server/src/cmd/set_parser.rs4
-rw-r--r--crates/whirl_server/src/net/property_parser.rs4
-rw-r--r--crates/whirl_server/src/packet_parser.rs6
3 files changed, 7 insertions, 7 deletions
diff --git a/crates/whirl_server/src/cmd/set_parser.rs b/crates/whirl_server/src/cmd/set_parser.rs
index 9d6a4b3..600badd 100644
--- a/crates/whirl_server/src/cmd/set_parser.rs
+++ b/crates/whirl_server/src/cmd/set_parser.rs
@@ -3,8 +3,8 @@
use crate::cmd::structure::Command;
-/// Iterate over a command set in the from of bytes and return a list of
-/// human-readable commands.
+/// Iterate over a command set in the from of bytes (Vec<u8>) and return a list
+/// of human-readable commands.
fn _parse_command_set(mut data: Vec<u8>) -> Vec<Command> {
let mut command_set = vec![];
diff --git a/crates/whirl_server/src/net/property_parser.rs b/crates/whirl_server/src/net/property_parser.rs
index f86b767..bce457d 100644
--- a/crates/whirl_server/src/net/property_parser.rs
+++ b/crates/whirl_server/src/net/property_parser.rs
@@ -5,8 +5,8 @@ use std::str::from_utf8;
use crate::net::structure::NetworkProperty;
-/// Iterate over a network property in the form of bytes and return a list of
-/// human-readable properties.
+/// Iterate over a network property in the form of bytes (Vec<u8>) and return a
+/// list of human-readable properties.
pub fn parse_network_property(mut data: Vec<u8>) -> Vec<NetworkProperty> {
let mut property_list = vec![];
diff --git a/crates/whirl_server/src/packet_parser.rs b/crates/whirl_server/src/packet_parser.rs
index bfeba9e..79293cb 100644
--- a/crates/whirl_server/src/packet_parser.rs
+++ b/crates/whirl_server/src/packet_parser.rs
@@ -3,13 +3,13 @@
use bytes::BytesMut;
-/// Read all commands from the given buffer.
+/// Read all commands from the given `buffer`.
///
/// # Process
-/// 1. Get a command from `buffer` based on first byte.
+/// 1. Read a command from `buffer` based on it's first byte.
/// 2. Push command to `commands`.
/// 3. Remove command from `buffer`.
-/// 4. Iterate and do this for all commands within `buffer`.
+/// 4. Iterate and do this for the remaining commands within `buffer`.
pub fn parse_commands_from_packet(mut buffer: BytesMut) -> Vec<BytesMut> {
let mut commands: Vec<BytesMut> = Vec::new();
trace!("initial buffer: {:?}, length: {}", buffer, buffer.len());