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 std::io;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{tcp, Packet};
|
||||
use bevy::prelude::*;
|
||||
use std::{collections::HashMap, io, net::ToSocketAddrs, sync::Arc};
|
||||
|
||||
#[cfg(feature = "sync")]
|
||||
use {
|
||||
use ::{
|
||||
serde::{de::DeserializeOwned, Serialize},
|
||||
std::{any::type_name, marker::PhantomData},
|
||||
};
|
||||
|
||||
use crate::{tcp, Packet};
|
||||
|
||||
/// A trait for a handler function.
|
||||
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 std::hash::{Hash, Hasher};
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::Serialize;
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use std::{
|
||||
collections::hash_map::DefaultHasher,
|
||||
hash::{Hash, Hasher},
|
||||
};
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
pub mod client;
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
use std::collections::HashMap;
|
||||
use std::io;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{tcp, Packet};
|
||||
use bevy::prelude::*;
|
||||
use std::{collections::HashMap, io, net::ToSocketAddrs, sync::Arc};
|
||||
|
||||
#[cfg(feature = "sync")]
|
||||
use {
|
||||
use ::{
|
||||
serde::{de::DeserializeOwned, Serialize},
|
||||
std::{any::type_name, marker::PhantomData, ops::Deref},
|
||||
};
|
||||
|
||||
use crate::{tcp, Packet};
|
||||
|
||||
/// A trait for a handler function.
|
||||
pub trait PacketHandlerFn:
|
||||
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")]
|
||||
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.
|
||||
pub struct Connection {
|
||||
|
|
Loading…
Reference in a new issue