Browse Source

protocol: rename module types to wrappers

ipv6
Denis Drakhnia 10 months ago
parent
commit
7260ee9984
  1. 2
      master/src/master_server.rs
  2. 2
      protocol/src/admin.rs
  3. 2
      protocol/src/cursor.rs
  4. 6
      protocol/src/filter.rs
  5. 2
      protocol/src/game.rs
  6. 2
      protocol/src/lib.rs
  7. 2
      protocol/src/server.rs
  8. 2
      protocol/src/server_info.rs
  9. 4
      protocol/src/wrappers.rs
  10. 2
      query/src/main.rs

2
master/src/master_server.rs

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

2
protocol/src/admin.rs

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

2
protocol/src/cursor.rs

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

6
protocol/src/filter.rs

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

2
protocol/src/game.rs

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

2
protocol/src/lib.rs

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

2
protocol/src/server.rs

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

2
protocol/src/server_info.rs

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

4
protocol/src/types.rs → protocol/src/wrappers.rs

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

2
query/src/main.rs

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

Loading…
Cancel
Save