protocol: rename module types to wrappers

This commit is contained in:
Denis Drakhnia 2024-01-21 12:20:36 +02:00
parent 529f3d8091
commit 7260ee9984
10 changed files with 13 additions and 13 deletions

View File

@ -14,7 +14,7 @@ use log::{debug, error, info, trace, warn};
use thiserror::Error;
use xash3d_protocol::filter::{Filter, FilterFlags, Version};
use xash3d_protocol::server::Region;
use xash3d_protocol::types::Str;
use xash3d_protocol::wrappers::Str;
use xash3d_protocol::{admin, game, master, server, Error as ProtocolError, ServerInfo};
use crate::config::{self, Config};

View File

@ -4,7 +4,7 @@
//! Admin packets.
use crate::cursor::{Cursor, CursorMut};
use crate::types::Hide;
use crate::wrappers::Hide;
use crate::{CursorError, Error};
/// Default hash length.

View File

@ -10,7 +10,7 @@ use std::str;
use thiserror::Error;
use super::color;
use super::types::Str;
use super::wrappers::Str;
/// The error type for `Cursor` and `CursorMut`.
#[derive(Error, Debug, PartialEq, Eq)]

View File

@ -37,7 +37,7 @@ use bitflags::bitflags;
use crate::cursor::{Cursor, GetKeyValue, PutKeyValue};
use crate::server::{ServerAdd, ServerFlags, ServerType};
use crate::types::Str;
use crate::wrappers::Str;
use crate::{CursorError, Error, ServerInfo};
bitflags! {
@ -296,9 +296,9 @@ impl fmt::Display for &Filter<'_> {
#[cfg(test)]
mod tests {
use super::super::cursor::CursorMut;
use super::super::types::Str;
use super::*;
use crate::cursor::CursorMut;
use crate::wrappers::Str;
macro_rules! tests {
($($name:ident$(($($predefined_f:ident: $predefined_v:expr),+ $(,)?))? {

View File

@ -130,7 +130,7 @@ impl<'a> Packet<'a> {
mod tests {
use super::*;
use crate::filter::{FilterFlags, Version};
use crate::types::Str;
use crate::wrappers::Str;
use std::net::Ipv4Addr;
#[test]

View File

@ -17,7 +17,7 @@ pub mod filter;
pub mod game;
pub mod master;
pub mod server;
pub mod types;
pub mod wrappers;
pub use cursor::Error as CursorError;
pub use server_info::ServerInfo;

View File

@ -9,7 +9,7 @@ use bitflags::bitflags;
use super::cursor::{Cursor, CursorMut, GetKeyValue, PutKeyValue};
use super::filter::Version;
use super::types::Str;
use super::wrappers::Str;
use super::{CursorError, Error};
/// Sended to a master server before `ServerAdd` packet.

View File

@ -3,7 +3,7 @@
use super::filter::{FilterFlags, Version};
use super::server::{Region, ServerAdd};
use super::types::Str;
use super::wrappers::Str;
/// Game server information.
#[derive(Clone, Debug)]

View File

@ -14,7 +14,7 @@ use crate::CursorError;
/// # Examples
///
/// ```rust
/// # use xash3d_protocol::types::Str;
/// # use xash3d_protocol::wrappers::Str;
/// let s = format!("{}", Str(b"\xff\talex\n"));
/// assert_eq!(s, "\\xff\\talex\\n");
/// ```
@ -78,7 +78,7 @@ impl<T> Deref for Str<T> {
/// # Examples
///
/// ```rust
/// # use xash3d_protocol::types::Hide;
/// # use xash3d_protocol::wrappers::Hide;
/// let s = format!("{}", Hide([1, 2, 3, 4]));
/// assert_eq!(s, "<hidden>");
/// ```

View File

@ -13,7 +13,7 @@ use std::time::{Duration, Instant};
use serde::{Serialize, Serializer};
use thiserror::Error;
use xash3d_protocol::types::Str;
use xash3d_protocol::wrappers::Str;
use xash3d_protocol::{color, game, master, server, Error as ProtocolError};
use crate::cli::Cli;