Revert "Réglage du formatage des fichiers"
This reverts commit 7aff62ecba
.
This commit is contained in:
parent
7aff62ecba
commit
44a2c507a3
|
@ -1,17 +1,13 @@
|
||||||
use std::collections::HashMap;
|
use crate::{tcp, Packet};
|
||||||
use std::io;
|
|
||||||
use std::net::ToSocketAddrs;
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
use std::{collections::HashMap, io, net::ToSocketAddrs, sync::Arc};
|
||||||
|
|
||||||
#[cfg(feature = "sync")]
|
#[cfg(feature = "sync")]
|
||||||
use {
|
use ::{
|
||||||
serde::{de::DeserializeOwned, Serialize},
|
serde::{de::DeserializeOwned, Serialize},
|
||||||
std::{any::type_name, marker::PhantomData},
|
std::{any::type_name, marker::PhantomData},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{tcp, Packet};
|
|
||||||
|
|
||||||
/// A trait for a handler function.
|
/// A trait for a handler function.
|
||||||
pub trait PacketHandlerFn: Fn(Vec<u8>, &mut World) + Send + Sync + 'static {}
|
pub trait PacketHandlerFn: Fn(Vec<u8>, &mut World) + Send + Sync + 'static {}
|
||||||
|
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -1,8 +1,8 @@
|
||||||
use std::collections::hash_map::DefaultHasher;
|
use serde::{de::DeserializeOwned, Serialize};
|
||||||
use std::hash::{Hash, Hasher};
|
use std::{
|
||||||
|
collections::hash_map::DefaultHasher,
|
||||||
use serde::de::DeserializeOwned;
|
hash::{Hash, Hasher},
|
||||||
use serde::Serialize;
|
};
|
||||||
|
|
||||||
#[cfg(feature = "client")]
|
#[cfg(feature = "client")]
|
||||||
pub mod client;
|
pub mod client;
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
use std::collections::HashMap;
|
use crate::{tcp, Packet};
|
||||||
use std::io;
|
|
||||||
use std::net::ToSocketAddrs;
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
use std::{collections::HashMap, io, net::ToSocketAddrs, sync::Arc};
|
||||||
|
|
||||||
#[cfg(feature = "sync")]
|
#[cfg(feature = "sync")]
|
||||||
use {
|
use ::{
|
||||||
serde::{de::DeserializeOwned, Serialize},
|
serde::{de::DeserializeOwned, Serialize},
|
||||||
std::{any::type_name, marker::PhantomData, ops::Deref},
|
std::{any::type_name, marker::PhantomData, ops::Deref},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{tcp, Packet};
|
|
||||||
|
|
||||||
/// A trait for a handler function.
|
/// A trait for a handler function.
|
||||||
pub trait PacketHandlerFn:
|
pub trait PacketHandlerFn:
|
||||||
Fn(Entity, ClientConnection, Vec<u8>, &mut World) + Send + Sync + 'static
|
Fn(Entity, ClientConnection, Vec<u8>, &mut World) + Send + Sync + 'static
|
||||||
|
|
17
src/tcp.rs
17
src/tcp.rs
|
@ -1,11 +1,16 @@
|
||||||
use std::io::{self, Read, Write};
|
use std::{
|
||||||
|
io::{self, Read, Write},
|
||||||
|
net::{Shutdown, TcpStream, ToSocketAddrs},
|
||||||
|
sync::{
|
||||||
|
atomic::{AtomicBool, Ordering},
|
||||||
|
mpsc::{channel, Receiver, Sender},
|
||||||
|
Arc, Mutex,
|
||||||
|
},
|
||||||
|
thread,
|
||||||
|
};
|
||||||
|
|
||||||
#[cfg(feature = "server")]
|
#[cfg(feature = "server")]
|
||||||
use std::net::TcpListener;
|
use std::net::TcpListener;
|
||||||
use std::net::{Shutdown, TcpStream, ToSocketAddrs};
|
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
|
||||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
|
||||||
use std::sync::{Arc, Mutex};
|
|
||||||
use std::thread;
|
|
||||||
|
|
||||||
/// A non-blocking TCP connection.
|
/// A non-blocking TCP connection.
|
||||||
pub struct Connection {
|
pub struct Connection {
|
||||||
|
|
Loading…
Reference in a new issue