Repository: AlexPikalov/cdrs (language: rust)

Issue:
Use rust edition 2018



Discussion / hints:

Fix patch:
diff --git a/.travis.yml b/.travis.yml
index 6a7b880..5770bc2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,7 +20,7 @@ script:
   # - cargo fmt -- --write-mode=diff
   - cargo build --verbose
   - cargo test --verbose
-  - cargo test --verbose -- --ignored
+  - cargo test --verbose --features e2e-tests
   - cargo test --features ssl
 
 deploy:
diff --git a/Cargo.toml b/Cargo.toml
index 351adbe..fe294af 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,7 @@
 name = "cdrs"
 version = "2.1.1"
 authors = ["Alex Pikalov <alex.pikalov.khar@gmail.com>"]
+edition = "2018"
 
 description = "Cassandra DB driver written in Rust"
 documentation = "https://docs.rs/cdrs"
@@ -18,7 +19,7 @@ v3 = []
 v4 = []
 # enable v5 feature when it's actually implemented
 # v5 = []
-appveyor = []
+e2e-tests = []
 
 [dependencies]
 byteorder = "1"
diff --git a/src/authenticators.rs b/src/authenticators.rs
index 0cb4d43..bae0074 100644
--- a/src/authenticators.rs
+++ b/src/authenticators.rs
@@ -1,4 +1,4 @@
-use types::CBytes;
+use crate::types::CBytes;
 
 pub trait Authenticator: Clone + Send + Sync {
   fn get_auth_token(&self) -> CBytes;
diff --git a/src/cluster/config_ssl.rs b/src/cluster/config_ssl.rs
index 773d2a5..cb3ee09 100644
--- a/src/cluster/config_ssl.rs
+++ b/src/cluster/config_ssl.rs
@@ -2,7 +2,7 @@
 use openssl::ssl::SslConnector;
 use std::time::Duration;
 
-use authenticators::Authenticator;
+use crate::authenticators::Authenticator;
 
 /// Cluster configuration that holds per node SSL configs
 pub struct ClusterSslConfig<'a, A: Authenticator + Sized>(pub Vec<NodeSslConfig<'a, A>>);
diff --git a/src/cluster/config_tcp.rs b/src/cluster/config_tcp.rs
index 40442ab..2e6a4ac 100644
--- a/src/cluster/config_tcp.rs
+++ b/src/cluster/config_tcp.rs
@@ -1,6 +1,6 @@
 use std::time::Duration;
 
-use authenticators::Authenticator;
+use crate::authenticators::Authenticator;
 
 /// Cluster configuration that holds per node TCP configs
 pub struct ClusterTcpConfig<'a, A: Authenticator + Sized>(pub Vec<NodeTcpConfig<'a, A>>);
diff --git a/src/cluster/mod.rs b/src/cluster/mod.rs
index dca61e3..49d0ca8 100644
--- a/src/cluster/mod.rs
+++ b/src/cluster/mod.rs
@@ -11,19 +11,21 @@ mod ssl_connection_pool;
 mod tcp_connection_pool;
 
 #[cfg(feature = "ssl")]
-pub use cluster::config_ssl::{ClusterSslConfig, NodeSslConfig, NodeSslConfigBuilder};
-pub use cluster::config_tcp::{ClusterTcpConfig, NodeTcpConfig, NodeTcpConfigBuilder};
-pub use cluster::pager::{QueryPager, SessionPager, PagerState};
+pub use crate::cluster::config_ssl::{ClusterSslConfig, NodeSslConfig, NodeSslConfigBuilder};
+pub use crate::cluster::config_tcp::{ClusterTcpConfig, NodeTcpConfig, NodeTcpConfigBuilder};
+pub use crate::cluster::pager::{PagerState, QueryPager, SessionPager};
 #[cfg(feature = "ssl")]
-pub use cluster::ssl_connection_pool::{new_ssl_pool, SslConnectionPool, SslConnectionsManager};
-pub use cluster::tcp_connection_pool::{
+pub use crate::cluster::ssl_connection_pool::{
+  new_ssl_pool, SslConnectionPool, SslConnectionsManager,
+};
+pub use crate::cluster::tcp_connection_pool::{
   new_tcp_pool, startup, TcpConnectionPool, TcpConnectionsManager,
 };
 
-use compression::Compression;
-use error;
-use query::{BatchExecutor, ExecExecutor, PrepareExecutor, QueryExecutor};
-use transport::CDRSTransport;
+use crate::compression::Compression;
+use crate::error;
+use crate::query::{BatchExecutor, ExecExecutor, PrepareExecutor, QueryExecutor};
+use crate::transport::CDRSTransport;
 
 /// `GetConnection` trait provides a unified interface for Session to get a connection
 /// from a load balancer
diff --git a/src/cluster/pager.rs b/src/cluster/pager.rs
index ab8fcd0..9e474a1 100644
--- a/src/cluster/pager.rs
+++ b/src/cluster/pager.rs
@@ -2,63 +2,75 @@ use r2d2;
 use std::cell::RefCell;
 use std::marker::PhantomData;
 
-use cluster::CDRSSession;
-use error;
-use frame::frame_result::{RowsMetadata, RowsMetadataFlag};
-use query::{PreparedQuery, QueryParamsBuilder};
-use transport::CDRSTransport;
-use types::rows::Row;
-use types::CBytes;
-
-pub struct SessionPager<'a,
- M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error>
-   + Sized,
- S: CDRSSession<'static, T, M> + 'a,
- T: CDRSTransport + 'static>
-{
+use crate::cluster::CDRSSession;
+use crate::error;
+use crate::frame::frame_result::{RowsMetadata, RowsMetadataFlag};
+use crate::query::{PreparedQuery, QueryParamsBuilder};
+use crate::transport::CDRSTransport;
+use crate::types::rows::Row;
+use crate::types::CBytes;
+
+pub struct SessionPager<
+  'a,
+  M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
+  S: CDRSSession<'static, T, M> + 'a,
+  T: CDRSTransport + 'static,
+> {
   page_size: i32,
   session: &'a S,
   transport_type: PhantomData<&'a T>,
   connection_type: PhantomData<&'a M>,
 }
 
-impl<'a,
-      'b: 'a,
-      M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
-      S: CDRSSession<'static, T, M>,
-      T: CDRSTransport + 'static> SessionPager<'a, M, S, T>
+impl<
+    'a,
+    'b: 'a,
+    M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
+    S: CDRSSession<'static, T, M>,
+    T: CDRSTransport + 'static,
+  > SessionPager<'a, M, S, T>
 {
   pub fn new(session: &'b S, page_size: i32) -> SessionPager<'a, M, S, T> {
-    SessionPager { session,
-                   page_size,
-                   transport_type: PhantomData,
-                   connection_type: PhantomData }
+    SessionPager {
+      session,
+      page_size,
+      transport_type: PhantomData,
+      connection_type: PhantomData,
+    }
   }
 
-  pub fn query_with_pager_state<Q>(&'a mut self,
-                                   query: Q,
-                                   state: PagerState)
-                                   -> QueryPager<'a, Q, SessionPager<'a, M, S, T>>
-    where Q: ToString
+  pub fn query_with_pager_state<Q>(
+    &'a mut self,
+    query: Q,
+    state: PagerState,
+  ) -> QueryPager<'a, Q, SessionPager<'a, M, S, T>>
+  where
+    Q: ToString,
   {
-    QueryPager { pager: self,
-                 pager_state: state,
-                 query }
+    QueryPager {
+      pager: self,
+      pager_state: state,
+      query,
+    }
   }
 
   pub fn query<Q>(&'a mut self, query: Q) -> QueryPager<'a, Q, SessionPager<'a, M, S, T>>
-    where Q: ToString
+  where
+    Q: ToString,
   {
     self.query_with_pager_state(query, PagerState::new())
   }
 
-  pub fn exec_with_pager_state(&'a mut self,
-                               query: &'a PreparedQuery,
-                               state: PagerState)
-                               -> ExecPager<'a, SessionPager<'a, M, S, T>> {
-    ExecPager { pager: self,
-                pager_state: state,
-                query }
+  pub fn exec_with_pager_state(
+    &'a mut self,
+    query: &'a PreparedQuery,
+    state: PagerState,
+  ) -> ExecPager<'a, SessionPager<'a, M, S, T>> {
+    ExecPager {
+      pager: self,
+      pager_state: state,
+      query,
+    }
   }
 
   pub fn exec(&'a mut self, query: &'a PreparedQuery) -> ExecPager<'a, SessionPager<'a, M, S, T>> {
@@ -72,11 +84,13 @@ pub struct QueryPager<'a, Q: ToString, P: 'a> {
   query: Q,
 }
 
-impl<'a,
-      Q: ToString,
-      T: CDRSTransport + 'static,
-      M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
-      S: CDRSSession<'static, T, M>> QueryPager<'a, Q, SessionPager<'a, M, S, T>>
+impl<
+    'a,
+    Q: ToString,
+    T: CDRSTransport + 'static,
+    M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
+    S: CDRSSession<'static, T, M>,
+  > QueryPager<'a, Q, SessionPager<'a, M, S, T>>
 {
   pub fn next(&mut self) -> error::Result<Vec<Row>> {
     let mut params = QueryParamsBuilder::new().page_size(self.pager.page_size);
@@ -84,21 +98,23 @@ impl<'a,
       params = params.paging_state(self.pager_state.cursor.clone().unwrap());
     }
 
-    let body = self.pager
-                   .session
-                   .query_with_params(self.query.to_string(), params.finalize())
-                   .and_then(|frame| frame.get_body())?;
+    let body = self
+      .pager
+      .session
+      .query_with_params(self.query.to_string(), params.finalize())
+      .and_then(|frame| frame.get_body())?;
 
-    let metadata_res: error::Result<RowsMetadata> =
-      body.as_rows_metadata()
-          .ok_or("Pager query should yield a vector of rows".into());
+    let metadata_res: error::Result<RowsMetadata> = body
+      .as_rows_metadata()
+      .ok_or("Pager query should yield a vector of rows".into());
     let metadata = metadata_res?;
 
     self.pager_state.has_more_pages =
       Some(RowsMetadataFlag::has_has_more_pages(metadata.flags.clone()));
     self.pager_state.cursor = metadata.paging_state.clone();
-    body.into_rows()
-        .ok_or("Pager query should yield a vector of rows".into())
+    body
+      .into_rows()
+      .ok_or("Pager query should yield a vector of rows".into())
   }
 
   pub fn has_more(&self) -> bool {
@@ -118,10 +134,12 @@ pub struct ExecPager<'a, P: 'a> {
   query: &'a PreparedQuery,
 }
 
-impl<'a,
-      T: CDRSTransport + 'static,
-      M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
-      S: CDRSSession<'static, T, M>> ExecPager<'a, SessionPager<'a, M, S, T>>
+impl<
+    'a,
+    T: CDRSTransport + 'static,
+    M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
+    S: CDRSSession<'static, T, M>,
+  > ExecPager<'a, SessionPager<'a, M, S, T>>
 {
   pub fn next(&mut self) -> error::Result<Vec<Row>> {
     let mut params = QueryParamsBuilder::new().page_size(self.pager.page_size);
@@ -129,21 +147,23 @@ impl<'a,
       params = params.paging_state(self.pager_state.cursor.clone().unwrap());
     }
 
-    let body = self.pager
-                   .session
-                   .exec_with_params(self.query, params.finalize())
-                   .and_then(|frame| frame.get_body())?;
+    let body = self
+      .pager
+      .session
+      .exec_with_params(self.query, params.finalize())
+      .and_then(|frame| frame.get_body())?;
 
-    let metadata_res: error::Result<RowsMetadata> =
-      body.as_rows_metadata()
-          .ok_or("Pager query should yield a vector of rows".into());
+    let metadata_res: error::Result<RowsMetadata> = body
+      .as_rows_metadata()
+      .ok_or("Pager query should yield a vector of rows".into());
     let metadata = metadata_res?;
 
     self.pager_state.has_more_pages =
       Some(RowsMetadataFlag::has_has_more_pages(metadata.flags.clone()));
     self.pager_state.cursor = metadata.paging_state.clone();
-    body.into_rows()
-        .ok_or("Pager query should yield a vector of rows".into())
+    body
+      .into_rows()
+      .ok_or("Pager query should yield a vector of rows".into())
   }
 
   pub fn has_more(&self) -> bool {
@@ -165,18 +185,24 @@ pub struct PagerState {
 
 impl PagerState {
   pub fn new() -> Self {
-    PagerState { cursor: None,
-                 has_more_pages: None }
+    PagerState {
+      cursor: None,
+      has_more_pages: None,
+    }
   }
 
   pub fn with_cursor(cursor: CBytes) -> Self {
-    PagerState { cursor: Some(cursor),
-                 has_more_pages: None }
+    PagerState {
+      cursor: Some(cursor),
+      has_more_pages: None,
+    }
   }
 
   pub fn with_cursor_and_more_flag(cursor: CBytes, has_more: bool) -> Self {
-    PagerState { cursor: Some(cursor),
-                 has_more_pages: Some(has_more) }
+    PagerState {
+      cursor: Some(cursor),
+      has_more_pages: Some(has_more),
+    }
   }
 
   pub fn has_more(&self) -> bool {
diff --git a/src/cluster/session.rs b/src/cluster/session.rs
index ee6fdd6..6946d8b 100644
--- a/src/cluster/session.rs
+++ b/src/cluster/session.rs
@@ -3,28 +3,28 @@ use std::cell::RefCell;
 use std::io::Write;
 
 #[cfg(feature = "ssl")]
-use cluster::{new_ssl_pool, ClusterSslConfig, SslConnectionPool};
-use cluster::{
+use crate::cluster::{new_ssl_pool, ClusterSslConfig, SslConnectionPool};
+use crate::cluster::{
   new_tcp_pool, startup, CDRSSession, ClusterTcpConfig, GetCompressor, GetConnection,
   TcpConnectionPool,
 };
-use error;
-use load_balancing::LoadBalancingStrategy;
-use transport::{CDRSTransport, TransportTcp};
-
-use authenticators::Authenticator;
-use cluster::SessionPager;
-use compression::Compression;
-use events::{new_listener, EventStream, Listener};
-use frame::events::SimpleServerEvent;
-use frame::parser::parse_frame;
-use frame::{Frame, IntoBytes};
-use query::{BatchExecutor, ExecExecutor, PrepareExecutor, QueryExecutor};
+use crate::error;
+use crate::load_balancing::LoadBalancingStrategy;
+use crate::transport::{CDRSTransport, TransportTcp};
+
+use crate::authenticators::Authenticator;
+use crate::cluster::SessionPager;
+use crate::compression::Compression;
+use crate::events::{new_listener, EventStream, Listener};
+use crate::frame::events::SimpleServerEvent;
+use crate::frame::parser::parse_frame;
+use crate::frame::{Frame, IntoBytes};
+use crate::query::{BatchExecutor, ExecExecutor, PrepareExecutor, QueryExecutor};
 
 #[cfg(feature = "ssl")]
-use openssl::ssl::SslConnector;
+use crate::transport::TransportTls;
 #[cfg(feature = "ssl")]
-use transport::TransportTls;
+use openssl::ssl::SslConnector;
 
 /// CDRS session that holds one pool of authorized connecitons per node.
 /// `compression` field contains data compressor that will be used
diff --git a/src/cluster/ssl_connection_pool.rs b/src/cluster/ssl_connection_pool.rs
index e7e6d96..26cfc0e 100644
--- a/src/cluster/ssl_connection_pool.rs
+++ b/src/cluster/ssl_connection_pool.rs
@@ -4,14 +4,14 @@ use std::cell::RefCell;
 use std::error::Error;
 use std::io::Write;
 
-use authenticators::Authenticator;
-use cluster::{startup, NodeSslConfig};
-use compression::Compression;
-use error;
-use frame::parser::parse_frame;
-use frame::{Frame, IntoBytes};
-use transport::CDRSTransport;
-use transport::TransportTls;
+use crate::authenticators::Authenticator;
+use crate::cluster::{startup, NodeSslConfig};
+use crate::compression::Compression;
+use crate::error;
+use crate::frame::parser::parse_frame;
+use crate::frame::{Frame, IntoBytes};
+use crate::transport::CDRSTransport;
+use crate::transport::TransportTls;
 
 /// Shortcut for `r2d2::Pool` type of SSL-based CDRS connections.
 pub type SslConnectionPool<A> = Pool<SslConnectionsManager<A>>;
@@ -68,7 +68,7 @@ impl<A: Authenticator + 'static + Send + Sync> ManageConnection for SslConnectio
 
   fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error> {
     let options_frame = Frame::new_req_options().into_cbytes();
-    try!(conn.borrow_mut().write(options_frame.as_slice()));
+    conn.borrow_mut().write(options_frame.as_slice())?;
 
     parse_frame(conn, &Compression::None {}).map(|_| ())
   }
diff --git a/src/cluster/tcp_connection_pool.rs b/src/cluster/tcp_connection_pool.rs
index 0562bba..43662ea 100644
--- a/src/cluster/tcp_connection_pool.rs
+++ b/src/cluster/tcp_connection_pool.rs
@@ -4,13 +4,13 @@ use std::error::Error;
 use std::io;
 use std::io::Write;
 
-use authenticators::Authenticator;
-use cluster::NodeTcpConfig;
-use compression::Compression;
-use error;
-use frame::parser::parse_frame;
-use frame::{Frame, IntoBytes, Opcode};
-use transport::{CDRSTransport, TransportTcp};
+use crate::authenticators::Authenticator;
+use crate::cluster::NodeTcpConfig;
+use crate::compression::Compression;
+use crate::error;
+use crate::frame::parser::parse_frame;
+use crate::frame::{Frame, IntoBytes, Opcode};
+use crate::transport::{CDRSTransport, TransportTcp};
 
 /// Shortcut for `r2d2::Pool` type of TCP-based CDRS connections.
 pub type TcpConnectionPool<A> = Pool<TcpConnectionsManager<A>>;
@@ -61,7 +61,7 @@ impl<A: Authenticator + 'static + Send + Sync> ManageConnection for TcpConnectio
 
   fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error> {
     let options_frame = Frame::new_req_options().into_cbytes();
-    try!(conn.borrow_mut().write(options_frame.as_slice()));
+    conn.borrow_mut().write(options_frame.as_slice())?;
 
     parse_frame(conn, &Compression::None {}).map(|_| ())
   }
@@ -80,7 +80,7 @@ pub fn startup<'b, T: CDRSTransport + 'static, A: Authenticator + 'static + Size
 
   transport.borrow_mut().write(startup_frame.as_slice())?;
 
-  let start_response = try!(parse_frame(transport, compression));
+  let start_response = parse_frame(transport, compression)?;
 
   if start_response.opcode == Opcode::Ready {
     return Ok(());
@@ -125,12 +125,12 @@ pub fn startup<'b, T: CDRSTransport + 'static, A: Authenticator + 'static + Size
     }
 
     let auth_token_bytes = session_authenticator.get_auth_token().into_cbytes();
-    try!(transport.borrow_mut().write(
+    transport.borrow_mut().write(
       Frame::new_req_auth_response(auth_token_bytes)
         .into_cbytes()
-        .as_slice()
-    ));
-    try!(parse_frame(transport, compression));
+        .as_slice(),
+    )?;
+    parse_frame(transport, compression)?;
 
     return Ok(());
   }
diff --git a/src/consistency.rs b/src/consistency.rs
index 74dbf59..f4e942d 100644
--- a/src/consistency.rs
+++ b/src/consistency.rs
@@ -4,268 +4,268 @@ use std::convert::From;
 use std::default::Default;
 use std::io;
 
-use error;
-use frame::{FromBytes, FromCursor, IntoBytes};
-use types::*;
+use crate::error;
+use crate::frame::{FromBytes, FromCursor, IntoBytes};
+use crate::types::*;
 
 /// `Consistency` is an enum which represents Cassandra's consistency levels.
 /// To find more details about each consistency level please refer to Cassandra official docs.
 #[derive(Debug, PartialEq, Clone, Copy)]
 pub enum Consistency {
-    /// A write must be written to the commit log and memtable on all replica nodes in the cluster
-    /// for that partition key.	Provides the highest consistency
-    /// and the lowest availability of any other level.
-    Any,
-    ///
-    /// A write must be written to the commit log and memtable of at least one replica node.
-    /// Satisfies the needs of most users because consistency requirements are not stringent.
-    One,
-    /// A write must be written to the commit log and memtable of at least two replica nodes.
-    /// Similar to ONE.
-    Two,
-    /// A write must be written to the commit log and memtable of at least three replica nodes.
-    /// Similar to TWO.
-    Three,
-    /// A write must be written to the commit log and memtable on a quorum of replica nodes.
-    /// Provides strong consistency if you can tolerate some level of failure.
-    Quorum,
-    /// A write must be written to the commit log and memtable on all replica nodes in the cluster
-    /// for that partition key.
-    /// Provides the highest consistency and the lowest availability of any other level.
-    All,
-    /// Strong consistency. A write must be written to the commit log and memtable on a quorum
-    /// of replica nodes in the same data center as thecoordinator node.
-    /// Avoids latency of inter-data center communication.
-    /// Used in multiple data center clusters with a rack-aware replica placement strategy,
-    /// such as NetworkTopologyStrategy, and a properly configured snitch.
-    /// Use to maintain consistency locally (within the single data center).
-    /// Can be used with SimpleStrategy.
-    LocalQuorum,
-    /// Strong consistency. A write must be written to the commit log and memtable on a quorum of
-    /// replica nodes in all data center.
-    /// Used in multiple data center clusters to strictly maintain consistency at the same level
-    /// in each data center. For example, choose this level
-    /// if you want a read to fail when a data center is down and the QUORUM
-    /// cannot be reached on that data center.
-    EachQuorum,
-    /// Achieves linearizable consistency for lightweight transactions by preventing unconditional
-    /// updates.	You cannot configure this level as a normal consistency level,
-    /// configured at the driver level using the consistency level field.
-    /// You configure this level using the serial consistency field
-    /// as part of the native protocol operation. See failure scenarios.
-    Serial,
-    /// Same as SERIAL but confined to the data center. A write must be written conditionally
-    /// to the commit log and memtable on a quorum of replica nodes in the same data center.
-    /// Same as SERIAL. Used for disaster recovery. See failure scenarios.
-    LocalSerial,
-    /// A write must be sent to, and successfully acknowledged by,
-    /// at least one replica node in the local data center.
-    /// In a multiple data center clusters, a consistency level of ONE is often desirable,
-    /// but cross-DC traffic is not. LOCAL_ONE accomplishes this.
-    /// For security and quality reasons, you can use this consistency level
-    /// in an offline datacenter to prevent automatic connection
-    /// to online nodes in other data centers if an offline node goes down.
-    LocalOne,
-    /// This is an error scenario either the client code doesn't support it or server is sending
-    /// bad headers
-    Unknown,
+  /// A write must be written to the commit log and memtable on all replica nodes in the cluster
+  /// for that partition key.	Provides the highest consistency
+  /// and the lowest availability of any other level.
+  Any,
+  ///
+  /// A write must be written to the commit log and memtable of at least one replica node.
+  /// Satisfies the needs of most users because consistency requirements are not stringent.
+  One,
+  /// A write must be written to the commit log and memtable of at least two replica nodes.
+  /// Similar to ONE.
+  Two,
+  /// A write must be written to the commit log and memtable of at least three replica nodes.
+  /// Similar to TWO.
+  Three,
+  /// A write must be written to the commit log and memtable on a quorum of replica nodes.
+  /// Provides strong consistency if you can tolerate some level of failure.
+  Quorum,
+  /// A write must be written to the commit log and memtable on all replica nodes in the cluster
+  /// for that partition key.
+  /// Provides the highest consistency and the lowest availability of any other level.
+  All,
+  /// Strong consistency. A write must be written to the commit log and memtable on a quorum
+  /// of replica nodes in the same data center as thecoordinator node.
+  /// Avoids latency of inter-data center communication.
+  /// Used in multiple data center clusters with a rack-aware replica placement strategy,
+  /// such as NetworkTopologyStrategy, and a properly configured snitch.
+  /// Use to maintain consistency locally (within the single data center).
+  /// Can be used with SimpleStrategy.
+  LocalQuorum,
+  /// Strong consistency. A write must be written to the commit log and memtable on a quorum of
+  /// replica nodes in all data center.
+  /// Used in multiple data center clusters to strictly maintain consistency at the same level
+  /// in each data center. For example, choose this level
+  /// if you want a read to fail when a data center is down and the QUORUM
+  /// cannot be reached on that data center.
+  EachQuorum,
+  /// Achieves linearizable consistency for lightweight transactions by preventing unconditional
+  /// updates.	You cannot configure this level as a normal consistency level,
+  /// configured at the driver level using the consistency level field.
+  /// You configure this level using the serial consistency field
+  /// as part of the native protocol operation. See failure scenarios.
+  Serial,
+  /// Same as SERIAL but confined to the data center. A write must be written conditionally
+  /// to the commit log and memtable on a quorum of replica nodes in the same data center.
+  /// Same as SERIAL. Used for disaster recovery. See failure scenarios.
+  LocalSerial,
+  /// A write must be sent to, and successfully acknowledged by,
+  /// at least one replica node in the local data center.
+  /// In a multiple data center clusters, a consistency level of ONE is often desirable,
+  /// but cross-DC traffic is not. LOCAL_ONE accomplishes this.
+  /// For security and quality reasons, you can use this consistency level
+  /// in an offline datacenter to prevent automatic connection
+  /// to online nodes in other data centers if an offline node goes down.
+  LocalOne,
+  /// This is an error scenario either the client code doesn't support it or server is sending
+  /// bad headers
+  Unknown,
 }
 
 impl Default for Consistency {
-    fn default() -> Consistency {
-        Consistency::One
-    }
+  fn default() -> Consistency {
+    Consistency::One
+  }
 }
 
 impl IntoBytes for Consistency {
-    fn into_cbytes(&self) -> Vec<u8> {
-        match *self {
-            Consistency::Any => to_short(0x0000),
-            Consistency::One => to_short(0x0001),
-            Consistency::Two => to_short(0x0002),
-            Consistency::Three => to_short(0x0003),
-            Consistency::Quorum => to_short(0x0004),
-            Consistency::All => to_short(0x0005),
-            Consistency::LocalQuorum => to_short(0x0006),
-            Consistency::EachQuorum => to_short(0x0007),
-            Consistency::Serial => to_short(0x0008),
-            Consistency::LocalSerial => to_short(0x0009),
-            Consistency::LocalOne => to_short(0x000A),
-            Consistency::Unknown => to_short(0x0063),
-            // giving Unknown a value of 99
-        }
+  fn into_cbytes(&self) -> Vec<u8> {
+    match *self {
+      Consistency::Any => to_short(0x0000),
+      Consistency::One => to_short(0x0001),
+      Consistency::Two => to_short(0x0002),
+      Consistency::Three => to_short(0x0003),
+      Consistency::Quorum => to_short(0x0004),
+      Consistency::All => to_short(0x0005),
+      Consistency::LocalQuorum => to_short(0x0006),
+      Consistency::EachQuorum => to_short(0x0007),
+      Consistency::Serial => to_short(0x0008),
+      Consistency::LocalSerial => to_short(0x0009),
+      Consistency::LocalOne => to_short(0x000A),
+      Consistency::Unknown => to_short(0x0063),
+      // giving Unknown a value of 99
     }
+  }
 }
 
 impl From<i32> for Consistency {
-    fn from(bytes: i32) -> Consistency {
-        match bytes {
-            0x0000 => Consistency::Any,
-            0x0001 => Consistency::One,
-            0x0002 => Consistency::Two,
-            0x0003 => Consistency::Three,
-            0x0004 => Consistency::Quorum,
-            0x0005 => Consistency::All,
-            0x0006 => Consistency::LocalQuorum,
-            0x0007 => Consistency::EachQuorum,
-            0x0008 => Consistency::Serial,
-            0x0009 => Consistency::LocalSerial,
-            0x000A => Consistency::LocalOne,
-            _ => Consistency::Unknown,
-        }
+  fn from(bytes: i32) -> Consistency {
+    match bytes {
+      0x0000 => Consistency::Any,
+      0x0001 => Consistency::One,
+      0x0002 => Consistency::Two,
+      0x0003 => Consistency::Three,
+      0x0004 => Consistency::Quorum,
+      0x0005 => Consistency::All,
+      0x0006 => Consistency::LocalQuorum,
+      0x0007 => Consistency::EachQuorum,
+      0x0008 => Consistency::Serial,
+      0x0009 => Consistency::LocalSerial,
+      0x000A => Consistency::LocalOne,
+      _ => Consistency::Unknown,
     }
+  }
 }
 
 impl FromBytes for Consistency {
-    fn from_bytes(bytes: &[u8]) -> error::Result<Consistency> {
-        try_from_bytes(bytes).map_err(Into::into).map(|b| match b {
-            0x0000 => Consistency::Any,
-            0x0001 => Consistency::One,
-            0x0002 => Consistency::Two,
-            0x0003 => Consistency::Three,
-            0x0004 => Consistency::Quorum,
-            0x0005 => Consistency::All,
-            0x0006 => Consistency::LocalQuorum,
-            0x0007 => Consistency::EachQuorum,
-            0x0008 => Consistency::Serial,
-            0x0009 => Consistency::LocalSerial,
-            0x000A => Consistency::LocalOne,
-            _ => Consistency::Unknown,
-        })
-    }
+  fn from_bytes(bytes: &[u8]) -> error::Result<Consistency> {
+    try_from_bytes(bytes).map_err(Into::into).map(|b| match b {
+      0x0000 => Consistency::Any,
+      0x0001 => Consistency::One,
+      0x0002 => Consistency::Two,
+      0x0003 => Consistency::Three,
+      0x0004 => Consistency::Quorum,
+      0x0005 => Consistency::All,
+      0x0006 => Consistency::LocalQuorum,
+      0x0007 => Consistency::EachQuorum,
+      0x0008 => Consistency::Serial,
+      0x0009 => Consistency::LocalSerial,
+      0x000A => Consistency::LocalOne,
+      _ => Consistency::Unknown,
+    })
+  }
 }
 
 impl FromCursor for Consistency {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<Consistency> {
-        let consistency_num = CIntShort::from_cursor(&mut cursor)? as i32;
-        Ok(Consistency::from(consistency_num))
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<Consistency> {
+    let consistency_num = CIntShort::from_cursor(&mut cursor)? as i32;
+    Ok(Consistency::from(consistency_num))
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use frame::traits::{FromBytes, FromCursor, IntoBytes};
-    use std::io::Cursor;
+  use super::*;
+  use crate::frame::traits::{FromBytes, FromCursor, IntoBytes};
+  use std::io::Cursor;
 
-    #[test]
-    fn test_consistency_into_cbytes() {
-        assert_eq!(Consistency::Any.into_cbytes(), &[0, 0]);
-        assert_eq!(Consistency::One.into_cbytes(), &[0, 1]);
-        assert_eq!(Consistency::Two.into_cbytes(), &[0, 2]);
-        assert_eq!(Consistency::Three.into_cbytes(), &[0, 3]);
-        assert_eq!(Consistency::Quorum.into_cbytes(), &[0, 4]);
-        assert_eq!(Consistency::All.into_cbytes(), &[0, 5]);
-        assert_eq!(Consistency::LocalQuorum.into_cbytes(), &[0, 6]);
-        assert_eq!(Consistency::EachQuorum.into_cbytes(), &[0, 7]);
-        assert_eq!(Consistency::Serial.into_cbytes(), &[0, 8]);
-        assert_eq!(Consistency::LocalSerial.into_cbytes(), &[0, 9]);
-        assert_eq!(Consistency::LocalOne.into_cbytes(), &[0, 10]);
-        assert_eq!(Consistency::Unknown.into_cbytes(), &[0, 99]);
-    }
+  #[test]
+  fn test_consistency_into_cbytes() {
+    assert_eq!(Consistency::Any.into_cbytes(), &[0, 0]);
+    assert_eq!(Consistency::One.into_cbytes(), &[0, 1]);
+    assert_eq!(Consistency::Two.into_cbytes(), &[0, 2]);
+    assert_eq!(Consistency::Three.into_cbytes(), &[0, 3]);
+    assert_eq!(Consistency::Quorum.into_cbytes(), &[0, 4]);
+    assert_eq!(Consistency::All.into_cbytes(), &[0, 5]);
+    assert_eq!(Consistency::LocalQuorum.into_cbytes(), &[0, 6]);
+    assert_eq!(Consistency::EachQuorum.into_cbytes(), &[0, 7]);
+    assert_eq!(Consistency::Serial.into_cbytes(), &[0, 8]);
+    assert_eq!(Consistency::LocalSerial.into_cbytes(), &[0, 9]);
+    assert_eq!(Consistency::LocalOne.into_cbytes(), &[0, 10]);
+    assert_eq!(Consistency::Unknown.into_cbytes(), &[0, 99]);
+  }
 
-    #[test]
-    fn test_consistency_from() {
-        assert_eq!(Consistency::from(0), Consistency::Any);
-        assert_eq!(Consistency::from(1), Consistency::One);
-        assert_eq!(Consistency::from(2), Consistency::Two);
-        assert_eq!(Consistency::from(3), Consistency::Three);
-        assert_eq!(Consistency::from(4), Consistency::Quorum);
-        assert_eq!(Consistency::from(5), Consistency::All);
-        assert_eq!(Consistency::from(6), Consistency::LocalQuorum);
-        assert_eq!(Consistency::from(7), Consistency::EachQuorum);
-        assert_eq!(Consistency::from(8), Consistency::Serial);
-        assert_eq!(Consistency::from(9), Consistency::LocalSerial);
-        assert_eq!(Consistency::from(10), Consistency::LocalOne);
-        assert_eq!(Consistency::from(11), Consistency::Unknown);
-    }
+  #[test]
+  fn test_consistency_from() {
+    assert_eq!(Consistency::from(0), Consistency::Any);
+    assert_eq!(Consistency::from(1), Consistency::One);
+    assert_eq!(Consistency::from(2), Consistency::Two);
+    assert_eq!(Consistency::from(3), Consistency::Three);
+    assert_eq!(Consistency::from(4), Consistency::Quorum);
+    assert_eq!(Consistency::from(5), Consistency::All);
+    assert_eq!(Consistency::from(6), Consistency::LocalQuorum);
+    assert_eq!(Consistency::from(7), Consistency::EachQuorum);
+    assert_eq!(Consistency::from(8), Consistency::Serial);
+    assert_eq!(Consistency::from(9), Consistency::LocalSerial);
+    assert_eq!(Consistency::from(10), Consistency::LocalOne);
+    assert_eq!(Consistency::from(11), Consistency::Unknown);
+  }
 
-    #[test]
-    fn test_consistency_from_bytes() {
-        assert_eq!(Consistency::from_bytes(&[0, 0]).unwrap(), Consistency::Any);
-        assert_eq!(Consistency::from_bytes(&[0, 1]).unwrap(), Consistency::One);
-        assert_eq!(Consistency::from_bytes(&[0, 2]).unwrap(), Consistency::Two);
-        assert_eq!(
-            Consistency::from_bytes(&[0, 3]).unwrap(),
-            Consistency::Three
-        );
-        assert_eq!(
-            Consistency::from_bytes(&[0, 4]).unwrap(),
-            Consistency::Quorum
-        );
-        assert_eq!(Consistency::from_bytes(&[0, 5]).unwrap(), Consistency::All);
-        assert_eq!(
-            Consistency::from_bytes(&[0, 6]).unwrap(),
-            Consistency::LocalQuorum
-        );
-        assert_eq!(
-            Consistency::from_bytes(&[0, 7]).unwrap(),
-            Consistency::EachQuorum
-        );
-        assert_eq!(
-            Consistency::from_bytes(&[0, 8]).unwrap(),
-            Consistency::Serial
-        );
-        assert_eq!(
-            Consistency::from_bytes(&[0, 9]).unwrap(),
-            Consistency::LocalSerial
-        );
-        assert_eq!(
-            Consistency::from_bytes(&[0, 10]).unwrap(),
-            Consistency::LocalOne
-        );
-        assert_eq!(
-            Consistency::from_bytes(&[0, 11]).unwrap(),
-            Consistency::Unknown
-        );
-    }
+  #[test]
+  fn test_consistency_from_bytes() {
+    assert_eq!(Consistency::from_bytes(&[0, 0]).unwrap(), Consistency::Any);
+    assert_eq!(Consistency::from_bytes(&[0, 1]).unwrap(), Consistency::One);
+    assert_eq!(Consistency::from_bytes(&[0, 2]).unwrap(), Consistency::Two);
+    assert_eq!(
+      Consistency::from_bytes(&[0, 3]).unwrap(),
+      Consistency::Three
+    );
+    assert_eq!(
+      Consistency::from_bytes(&[0, 4]).unwrap(),
+      Consistency::Quorum
+    );
+    assert_eq!(Consistency::from_bytes(&[0, 5]).unwrap(), Consistency::All);
+    assert_eq!(
+      Consistency::from_bytes(&[0, 6]).unwrap(),
+      Consistency::LocalQuorum
+    );
+    assert_eq!(
+      Consistency::from_bytes(&[0, 7]).unwrap(),
+      Consistency::EachQuorum
+    );
+    assert_eq!(
+      Consistency::from_bytes(&[0, 8]).unwrap(),
+      Consistency::Serial
+    );
+    assert_eq!(
+      Consistency::from_bytes(&[0, 9]).unwrap(),
+      Consistency::LocalSerial
+    );
+    assert_eq!(
+      Consistency::from_bytes(&[0, 10]).unwrap(),
+      Consistency::LocalOne
+    );
+    assert_eq!(
+      Consistency::from_bytes(&[0, 11]).unwrap(),
+      Consistency::Unknown
+    );
+  }
 
-    #[test]
-    fn test_consistency_from_cursor() {
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 0])).unwrap(),
-            Consistency::Any
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 1])).unwrap(),
-            Consistency::One
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 2])).unwrap(),
-            Consistency::Two
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 3])).unwrap(),
-            Consistency::Three
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 4])).unwrap(),
-            Consistency::Quorum
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 5])).unwrap(),
-            Consistency::All
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 6])).unwrap(),
-            Consistency::LocalQuorum
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 7])).unwrap(),
-            Consistency::EachQuorum
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 8])).unwrap(),
-            Consistency::Serial
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 9])).unwrap(),
-            Consistency::LocalSerial
-        );
-        assert_eq!(
-            Consistency::from_cursor(&mut Cursor::new(&[0, 10])).unwrap(),
-            Consistency::LocalOne
-        );
-    }
+  #[test]
+  fn test_consistency_from_cursor() {
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 0])).unwrap(),
+      Consistency::Any
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 1])).unwrap(),
+      Consistency::One
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 2])).unwrap(),
+      Consistency::Two
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 3])).unwrap(),
+      Consistency::Three
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 4])).unwrap(),
+      Consistency::Quorum
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 5])).unwrap(),
+      Consistency::All
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 6])).unwrap(),
+      Consistency::LocalQuorum
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 7])).unwrap(),
+      Consistency::EachQuorum
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 8])).unwrap(),
+      Consistency::Serial
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 9])).unwrap(),
+      Consistency::LocalSerial
+    );
+    assert_eq!(
+      Consistency::from_cursor(&mut Cursor::new(&[0, 10])).unwrap(),
+      Consistency::LocalOne
+    );
+  }
 
 }
diff --git a/src/error.rs b/src/error.rs
index db0e2d4..f7dd8e2 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,11 +1,12 @@
 use std::error;
 use std::fmt;
+use std::fmt::Display;
 use std::io;
 use std::result;
 use std::string::FromUtf8Error;
-use std::fmt::Display;
-use frame::frame_error::CDRSError;
-use compression::CompressionError;
+
+use crate::compression::CompressionError;
+use crate::frame::frame_error::CDRSError;
 use uuid::BytesError;
 
 pub type Result<T> = result::Result<T, Error>;
@@ -17,89 +18,89 @@ pub type Result<T> = result::Result<T, Error>;
 /// a Server via result error frames.
 #[derive(Debug)]
 pub enum Error {
-    /// Internal IO error.
-    Io(io::Error),
-    /// Internal error that may be raised during `uuid::Uuid::from_bytes`
-    UUIDParse(BytesError),
-    /// General error
-    General(String),
-    /// Internal error that may be raised during `String::from_utf8`
-    FromUtf8(FromUtf8Error),
-    /// Internal Compression/Decompression error
-    Compression(CompressionError),
-    /// Server error.
-    Server(CDRSError),
+  /// Internal IO error.
+  Io(io::Error),
+  /// Internal error that may be raised during `uuid::Uuid::from_bytes`
+  UUIDParse(BytesError),
+  /// General error
+  General(String),
+  /// Internal error that may be raised during `String::from_utf8`
+  FromUtf8(FromUtf8Error),
+  /// Internal Compression/Decompression error
+  Compression(CompressionError),
+  /// Server error.
+  Server(CDRSError),
 }
 
 pub fn column_is_empty_err<T: Display>(column_name: T) -> Error {
-    Error::General(format!("Column or UDT property '{}' is empty", column_name))
+  Error::General(format!("Column or UDT property '{}' is empty", column_name))
 }
 
 impl fmt::Display for Error {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match *self {
-            Error::Io(ref err) => write!(f, "IO error: {}", err),
-            Error::Compression(ref err) => write!(f, "Compressor error: {}", err),
-            Error::Server(ref err) => write!(f, "Server error: {:?}", err.message),
-            Error::FromUtf8(ref err) => write!(f, "FromUtf8Error error: {:?}", err),
-            Error::UUIDParse(ref err) => write!(f, "UUIDParse error: {:?}", err),
-            Error::General(ref err) => write!(f, "GeneralParsing error: {:?}", err),
-        }
+  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    match *self {
+      Error::Io(ref err) => write!(f, "IO error: {}", err),
+      Error::Compression(ref err) => write!(f, "Compressor error: {}", err),
+      Error::Server(ref err) => write!(f, "Server error: {:?}", err.message),
+      Error::FromUtf8(ref err) => write!(f, "FromUtf8Error error: {:?}", err),
+      Error::UUIDParse(ref err) => write!(f, "UUIDParse error: {:?}", err),
+      Error::General(ref err) => write!(f, "GeneralParsing error: {:?}", err),
     }
+  }
 }
 
 impl error::Error for Error {
-    fn description(&self) -> &str {
-        match *self {
-            Error::Io(ref err) => err.description(),
-            Error::Compression(ref err) => err.description(),
-            Error::Server(ref err) => err.message.as_str(),
-            Error::FromUtf8(ref err) => err.description(),
-            // FIXME: err.description not found in current scope, std::error::Error not satisfied
-            Error::UUIDParse(_) => "UUID Parse Error",
-            Error::General(ref err) => err.as_str(),
-        }
+  fn description(&self) -> &str {
+    match *self {
+      Error::Io(ref err) => err.description(),
+      Error::Compression(ref err) => err.description(),
+      Error::Server(ref err) => err.message.as_str(),
+      Error::FromUtf8(ref err) => err.description(),
+      // FIXME: err.description not found in current scope, std::error::Error not satisfied
+      Error::UUIDParse(_) => "UUID Parse Error",
+      Error::General(ref err) => err.as_str(),
     }
+  }
 }
 
 impl From<io::Error> for Error {
-    fn from(err: io::Error) -> Error {
-        Error::Io(err)
-    }
+  fn from(err: io::Error) -> Error {
+    Error::Io(err)
+  }
 }
 
 impl From<CDRSError> for Error {
-    fn from(err: CDRSError) -> Error {
-        Error::Server(err)
-    }
+  fn from(err: CDRSError) -> Error {
+    Error::Server(err)
+  }
 }
 
 impl From<CompressionError> for Error {
-    fn from(err: CompressionError) -> Error {
-        Error::Compression(err)
-    }
+  fn from(err: CompressionError) -> Error {
+    Error::Compression(err)
+  }
 }
 
 impl From<FromUtf8Error> for Error {
-    fn from(err: FromUtf8Error) -> Error {
-        Error::FromUtf8(err)
-    }
+  fn from(err: FromUtf8Error) -> Error {
+    Error::FromUtf8(err)
+  }
 }
 
 impl From<BytesError> for Error {
-    fn from(err: BytesError) -> Error {
-        Error::UUIDParse(err)
-    }
+  fn from(err: BytesError) -> Error {
+    Error::UUIDParse(err)
+  }
 }
 
 impl From<String> for Error {
-    fn from(err: String) -> Error {
-        Error::General(err)
-    }
+  fn from(err: String) -> Error {
+    Error::General(err)
+  }
 }
 
 impl<'a> From<&'a str> for Error {
-    fn from(err: &str) -> Error {
-        Error::General(err.to_string())
-    }
+  fn from(err: &str) -> Error {
+    Error::General(err.to_string())
+  }
 }
diff --git a/src/events.rs b/src/events.rs
index 1e923d0..39e58a8 100644
--- a/src/events.rs
+++ b/src/events.rs
@@ -1,16 +1,16 @@
 use std::cell::RefCell;
+use std::error::Error;
 use std::iter::Iterator;
 use std::sync::mpsc::{channel, Receiver, Sender};
 
-use compression::Compression;
-use error;
-use frame::events::{
-    SchemaChange as FrameSchemaChange, ServerEvent as FrameServerEvent,
-    SimpleServerEvent as FrameSimpleServerEvent,
+use crate::compression::Compression;
+use crate::error;
+use crate::frame::events::{
+  SchemaChange as FrameSchemaChange, ServerEvent as FrameServerEvent,
+  SimpleServerEvent as FrameSimpleServerEvent,
 };
-use frame::parser::parse_frame;
-use std::error::Error;
-use transport::CDRSTransport;
+use crate::frame::parser::parse_frame;
+use crate::transport::CDRSTransport;
 
 /// Full Server Event which includes all details about occured change.
 pub type ServerEvent = FrameServerEvent;
@@ -31,13 +31,13 @@ pub type SchemaChange = FrameSchemaChange;
 /// `EventStream` is an iterator which returns new events once they come.
 /// It is similar to `Receiver::iter`.
 pub fn new_listener<X>(transport: X) -> (Listener<X>, EventStream) {
-    let (tx, rx) = channel();
-    let listener = Listener {
-        transport: transport,
-        tx: tx,
-    };
-    let stream = EventStream { rx: rx };
-    (listener, stream)
+  let (tx, rx) = channel();
+  let listener = Listener {
+    transport: transport,
+    tx: tx,
+  };
+  let stream = EventStream { rx: rx };
+  (listener, stream)
 }
 
 /// `Listener` provides only one function `start` to start listening. It
@@ -45,42 +45,42 @@ pub fn new_listener<X>(transport: X) -> (Listener<X>, EventStream) {
 /// main thread.
 
 pub struct Listener<X> {
-    transport: X,
-    tx: Sender<ServerEvent>,
+  transport: X,
+  tx: Sender<ServerEvent>,
 }
 
 impl<X: CDRSTransport + 'static> Listener<RefCell<X>> {
-    /// It starts a process of listening to new events. Locks a frame.
-    pub fn start(self, compressor: &Compression) -> error::Result<()> {
-        loop {
-            let event_opt = try!(parse_frame(&self.transport, compressor))
-                .get_body()?
-                .into_server_event();
+  /// It starts a process of listening to new events. Locks a frame.
+  pub fn start(self, compressor: &Compression) -> error::Result<()> {
+    loop {
+      let event_opt = parse_frame(&self.transport, compressor)?
+        .get_body()?
+        .into_server_event();
 
-            let event = if event_opt.is_some() {
-                // unwrap is safe as we've checked that event_opt.is_some()
-                event_opt.unwrap().event as ServerEvent
-            } else {
-                continue;
-            };
-            match self.tx.send(event) {
-                Err(err) => return Err(error::Error::General(err.description().to_string())),
-                _ => continue,
-            }
-        }
+      let event = if event_opt.is_some() {
+        // unwrap is safe as we've checked that event_opt.is_some()
+        event_opt.unwrap().event as ServerEvent
+      } else {
+        continue;
+      };
+      match self.tx.send(event) {
+        Err(err) => return Err(error::Error::General(err.description().to_string())),
+        _ => continue,
+      }
     }
+  }
 }
 
 /// `EventStream` is an iterator which returns new events once they come.
 /// It is similar to `Receiver::iter`.
 pub struct EventStream {
-    rx: Receiver<ServerEvent>,
+  rx: Receiver<ServerEvent>,
 }
 
 impl Iterator for EventStream {
-    type Item = ServerEvent;
+  type Item = ServerEvent;
 
-    fn next(&mut self) -> Option<Self::Item> {
-        self.rx.recv().ok()
-    }
+  fn next(&mut self) -> Option<Self::Item> {
+    self.rx.recv().ok()
+  }
 }
diff --git a/src/frame/events.rs b/src/frame/events.rs
index c36276b..3056ee8 100644
--- a/src/frame/events.rs
+++ b/src/frame/events.rs
@@ -1,9 +1,9 @@
 use std::io::Cursor;
 use std::cmp::PartialEq;
 
-use frame::traits::FromCursor;
-use error;
-use types::{CInet, CString, CStringList};
+use crate::frame::traits::FromCursor;
+use crate::error;
+use crate::types::{CInet, CString, CStringList};
 
 // Event types
 const TOPOLOGY_CHANGE: &'static str = "TOPOLOGY_CHANGE";
@@ -307,7 +307,7 @@ mod simple_server_event_test {
 mod topology_change_type_test {
     use super::*;
     use std::io::Cursor;
-    use frame::traits::FromCursor;
+    use crate::frame::traits::FromCursor;
 
     #[test]
     fn from_cursor() {
@@ -335,7 +335,7 @@ mod topology_change_type_test {
 mod status_change_type_test {
     use super::*;
     use std::io::Cursor;
-    use frame::traits::FromCursor;
+    use crate::frame::traits::FromCursor;
 
     #[test]
     fn from_cursor() {
@@ -363,7 +363,7 @@ mod status_change_type_test {
 mod schema_change_type_test {
     use super::*;
     use std::io::Cursor;
-    use frame::traits::FromCursor;
+    use crate::frame::traits::FromCursor;
 
     #[test]
     fn from_cursor() {
@@ -396,7 +396,7 @@ mod schema_change_type_test {
 mod schema_change_target_test {
     use super::*;
     use std::io::Cursor;
-    use frame::traits::FromCursor;
+    use crate::frame::traits::FromCursor;
 
     #[test]
     fn from_cursor() {
@@ -437,7 +437,7 @@ mod schema_change_target_test {
 mod server_event {
     use super::*;
     use std::io::Cursor;
-    use frame::traits::FromCursor;
+    use crate::frame::traits::FromCursor;
 
     #[test]
     fn topology_change_new_node() {
diff --git a/src/frame/frame_auth_challenge.rs b/src/frame/frame_auth_challenge.rs
index 61f857b..089a3fb 100644
--- a/src/frame/frame_auth_challenge.rs
+++ b/src/frame/frame_auth_challenge.rs
@@ -1,8 +1,8 @@
 use std::io::Cursor;
 
-use frame::FromCursor;
-use error;
-use types::CBytes;
+use crate::frame::FromCursor;
+use crate::error;
+use crate::types::CBytes;
 
 /// Server authentication challenge.
 #[derive(Debug)]
@@ -20,7 +20,7 @@ impl FromCursor for BodyResAuthChallenge {
 mod tests {
     use std::io::Cursor;
     use super::*;
-    use frame::traits::FromCursor;
+    use crate::frame::traits::FromCursor;
 
     #[test]
     fn body_res_auth_challenge_from_cursor() {
diff --git a/src/frame/frame_auth_response.rs b/src/frame/frame_auth_response.rs
index 41643c6..7894f78 100644
--- a/src/frame/frame_auth_response.rs
+++ b/src/frame/frame_auth_response.rs
@@ -1,70 +1,72 @@
 use rand;
 
-use types::CBytes;
-use frame::*;
+use crate::frame::*;
+use crate::types::CBytes;
 
 #[derive(Debug)]
 pub struct BodyReqAuthResponse {
-    data: CBytes,
+  data: CBytes,
 }
 
 impl BodyReqAuthResponse {
-    pub fn new(data: CBytes) -> BodyReqAuthResponse {
-        BodyReqAuthResponse { data: data }
-    }
+  pub fn new(data: CBytes) -> BodyReqAuthResponse {
+    BodyReqAuthResponse { data: data }
+  }
 }
 
 impl IntoBytes for BodyReqAuthResponse {
-    fn into_cbytes(&self) -> Vec<u8> {
-        self.data.into_cbytes()
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    self.data.into_cbytes()
+  }
 }
 
 // Frame implementation related to BodyReqStartup
 
 impl Frame {
-    /// Creates new frame of type `AuthResponse`.
-    pub fn new_req_auth_response(bytes: Vec<u8>) -> Frame {
-        let version = Version::Request;
-        let flag = Flag::Ignore;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::AuthResponse;
-        let body = BodyReqAuthResponse::new(CBytes::new(bytes));
+  /// Creates new frame of type `AuthResponse`.
+  pub fn new_req_auth_response(bytes: Vec<u8>) -> Frame {
+    let version = Version::Request;
+    let flag = Flag::Ignore;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::AuthResponse;
+    let body = BodyReqAuthResponse::new(CBytes::new(bytes));
 
-        Frame { version: version,
-                flags: vec![flag],
-                stream: stream,
-                opcode: opcode,
-                body: body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+    Frame {
+      version: version,
+      flags: vec![flag],
+      stream: stream,
+      opcode: opcode,
+      body: body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use types::CBytes;
-    use frame::traits::IntoBytes;
+  use super::*;
+  use crate::frame::traits::IntoBytes;
+  use crate::types::CBytes;
 
-    #[test]
-    fn body_req_auth_response() {
-        let bytes = CBytes::new(vec![1, 2, 3]);
-        let body = BodyReqAuthResponse::new(bytes);
-        assert_eq!(body.into_cbytes(), vec![0, 0, 0, 3, 1, 2, 3]);
-    }
+  #[test]
+  fn body_req_auth_response() {
+    let bytes = CBytes::new(vec![1, 2, 3]);
+    let body = BodyReqAuthResponse::new(bytes);
+    assert_eq!(body.into_cbytes(), vec![0, 0, 0, 3, 1, 2, 3]);
+  }
 
-    #[test]
-    fn frame_body_req_auth_response() {
-        let bytes = vec![1, 2, 3];
-        let frame = Frame::new_req_auth_response(bytes);
+  #[test]
+  fn frame_body_req_auth_response() {
+    let bytes = vec![1, 2, 3];
+    let frame = Frame::new_req_auth_response(bytes);
 
-        assert_eq!(frame.version, Version::Request);
-        assert_eq!(frame.flags, vec![Flag::Ignore]);
-        assert_eq!(frame.opcode, Opcode::AuthResponse);
-        assert_eq!(frame.body, &[0, 0, 0, 3, 1, 2, 3]);
-        assert_eq!(frame.tracing_id, None);
-        assert_eq!(frame.warnings.len(), 0);
-    }
+    assert_eq!(frame.version, Version::Request);
+    assert_eq!(frame.flags, vec![Flag::Ignore]);
+    assert_eq!(frame.opcode, Opcode::AuthResponse);
+    assert_eq!(frame.body, &[0, 0, 0, 3, 1, 2, 3]);
+    assert_eq!(frame.tracing_id, None);
+    assert_eq!(frame.warnings.len(), 0);
+  }
 }
diff --git a/src/frame/frame_auth_success.rs b/src/frame/frame_auth_success.rs
index 2a5ebe0..4639f88 100644
--- a/src/frame/frame_auth_success.rs
+++ b/src/frame/frame_auth_success.rs
@@ -1,29 +1,29 @@
 use std::io::Cursor;
 
-use frame::FromCursor;
-use error;
+use crate::error;
+use crate::frame::FromCursor;
 
 /// `BodyReqAuthSuccess` is a frame that represents a successfull authentication response.
 #[derive(Debug, PartialEq)]
 pub struct BodyReqAuthSuccess {}
 
 impl FromCursor for BodyReqAuthSuccess {
-    fn from_cursor(mut _cursor: &mut Cursor<&[u8]>) -> error::Result<BodyReqAuthSuccess> {
-        Ok(BodyReqAuthSuccess {})
-    }
+  fn from_cursor(mut _cursor: &mut Cursor<&[u8]>) -> error::Result<BodyReqAuthSuccess> {
+    Ok(BodyReqAuthSuccess {})
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use std::io::Cursor;
-    use super::*;
-    use frame::traits::FromCursor;
+  use super::*;
+  use crate::frame::traits::FromCursor;
+  use std::io::Cursor;
 
-    #[test]
-    fn test_name() {
-        let rnd_bytes = [4, 5, 3, 8, 4, 6, 5, 0, 3, 7, 2];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(&rnd_bytes);
-        let body = BodyReqAuthSuccess::from_cursor(&mut cursor).unwrap();
-        assert_eq!(body, BodyReqAuthSuccess {});
-    }
+  #[test]
+  fn test_name() {
+    let rnd_bytes = [4, 5, 3, 8, 4, 6, 5, 0, 3, 7, 2];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(&rnd_bytes);
+    let body = BodyReqAuthSuccess::from_cursor(&mut cursor).unwrap();
+    assert_eq!(body, BodyReqAuthSuccess {});
+  }
 }
diff --git a/src/frame/frame_authenticate.rs b/src/frame/frame_authenticate.rs
index 4eb00d4..4fc834c 100644
--- a/src/frame/frame_authenticate.rs
+++ b/src/frame/frame_authenticate.rs
@@ -1,33 +1,35 @@
 use std::io::Cursor;
 
-use frame::FromCursor;
-use error;
-use types::CString;
+use crate::error;
+use crate::frame::FromCursor;
+use crate::types::CString;
 
 /// A server authentication challenge.
 #[derive(Debug)]
 pub struct BodyResAuthenticate {
-    pub data: CString,
+  pub data: CString,
 }
 
 impl FromCursor for BodyResAuthenticate {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> error::Result<BodyResAuthenticate> {
-        Ok(BodyResAuthenticate { data: CString::from_cursor(&mut cursor)?, })
-    }
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> error::Result<BodyResAuthenticate> {
+    Ok(BodyResAuthenticate {
+      data: CString::from_cursor(&mut cursor)?,
+    })
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use std::io::Cursor;
-    use frame::traits::FromCursor;
+  use super::*;
+  use crate::frame::traits::FromCursor;
+  use std::io::Cursor;
 
-    #[test]
-    fn body_res_authenticate() {
-        // string "abcde"
-        let data = [0, 5, 97, 98, 99, 100, 101];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(&data);
-        let body = BodyResAuthenticate::from_cursor(&mut cursor).unwrap();
-        assert_eq!(body.data.as_str(), "abcde");
-    }
+  #[test]
+  fn body_res_authenticate() {
+    // string "abcde"
+    let data = [0, 5, 97, 98, 99, 100, 101];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(&data);
+    let body = BodyResAuthenticate::from_cursor(&mut cursor).unwrap();
+    assert_eq!(body.data.as_str(), "abcde");
+  }
 }
diff --git a/src/frame/frame_batch.rs b/src/frame/frame_batch.rs
index 56a5c59..1bedbd2 100644
--- a/src/frame/frame_batch.rs
+++ b/src/frame/frame_batch.rs
@@ -1,155 +1,160 @@
 use rand;
-use frame::*;
-use query::QueryFlags;
-use types::*;
-use consistency::Consistency;
-use query::QueryValues;
+
+use crate::consistency::Consistency;
+use crate::frame::*;
+use crate::query::QueryFlags;
+use crate::query::QueryValues;
+use crate::types::*;
 
 /// `BodyResReady`
 #[derive(Debug, Clone)]
 pub struct BodyReqBatch {
-    pub batch_type: BatchType,
-    pub queries: Vec<BatchQuery>,
-    pub consistency: Consistency,
-    /// **IMPORTANT NOTE:** with names flag does not work and should not be used.
-    /// https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L413
-    pub query_flags: Vec<QueryFlags>,
-    pub serial_consistency: Option<Consistency>,
-    pub timestamp: Option<i64>,
+  pub batch_type: BatchType,
+  pub queries: Vec<BatchQuery>,
+  pub consistency: Consistency,
+  /// **IMPORTANT NOTE:** with names flag does not work and should not be used.
+  /// https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L413
+  pub query_flags: Vec<QueryFlags>,
+  pub serial_consistency: Option<Consistency>,
+  pub timestamp: Option<i64>,
 }
 
 impl IntoBytes for BodyReqBatch {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut bytes = vec![];
-
-        bytes.push(self.batch_type.as_byte());
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut bytes = vec![];
 
-        bytes.extend_from_slice(to_short(self.queries.len() as i16).as_slice());
+    bytes.push(self.batch_type.as_byte());
 
-        bytes = self.queries.iter().fold(bytes, |mut _bytes, q| {
-            _bytes.extend_from_slice(q.into_cbytes().as_slice());
-            _bytes
-        });
+    bytes.extend_from_slice(to_short(self.queries.len() as i16).as_slice());
 
-        bytes.extend_from_slice(self.consistency.into_cbytes().as_slice());
+    bytes = self.queries.iter().fold(bytes, |mut _bytes, q| {
+      _bytes.extend_from_slice(q.into_cbytes().as_slice());
+      _bytes
+    });
 
-        let flag_byte = self.query_flags.iter()
-                            .fold(0, |mut _bytes, f| _bytes | f.as_byte());
-        bytes.push(flag_byte);
+    bytes.extend_from_slice(self.consistency.into_cbytes().as_slice());
 
-        if let Some(ref serial_consistency) = self.serial_consistency {
-            bytes.extend_from_slice(serial_consistency.into_cbytes().as_slice());
-        }
+    let flag_byte = self
+      .query_flags
+      .iter()
+      .fold(0, |mut _bytes, f| _bytes | f.as_byte());
+    bytes.push(flag_byte);
 
-        if let Some(ref timestamp) = self.timestamp {
-            //bytes.extend_from_slice(to_bigint(timestamp.clone()).as_slice());
-            bytes.extend_from_slice(to_bigint(*timestamp).as_slice());
-        }
+    if let Some(ref serial_consistency) = self.serial_consistency {
+      bytes.extend_from_slice(serial_consistency.into_cbytes().as_slice());
+    }
 
-        bytes
+    if let Some(ref timestamp) = self.timestamp {
+      //bytes.extend_from_slice(to_bigint(timestamp.clone()).as_slice());
+      bytes.extend_from_slice(to_bigint(*timestamp).as_slice());
     }
+
+    bytes
+  }
 }
 
 /// Batch type
 #[derive(Debug, Clone, PartialEq)]
 pub enum BatchType {
-    /// The batch will be "logged". This is equivalent to a
-    /// normal CQL3 batch statement.
-    Logged,
-    /// The batch will be "unlogged".
-    Unlogged,
-    /// The batch will be a "counter" batch (and non-counter
-    /// statements will be rejected).
-    Counter,
+  /// The batch will be "logged". This is equivalent to a
+  /// normal CQL3 batch statement.
+  Logged,
+  /// The batch will be "unlogged".
+  Unlogged,
+  /// The batch will be a "counter" batch (and non-counter
+  /// statements will be rejected).
+  Counter,
 }
 
 impl FromSingleByte for BatchType {
-    fn from_byte(byte: u8) -> BatchType {
-        match byte {
-            0 => BatchType::Logged,
-            1 => BatchType::Unlogged,
-            2 => BatchType::Counter,
-            _ => unreachable!(),
-        }
+  fn from_byte(byte: u8) -> BatchType {
+    match byte {
+      0 => BatchType::Logged,
+      1 => BatchType::Unlogged,
+      2 => BatchType::Counter,
+      _ => unreachable!(),
     }
+  }
 }
 
 impl AsByte for BatchType {
-    fn as_byte(&self) -> u8 {
-        match *self {
-            BatchType::Logged => 0,
-            BatchType::Unlogged => 1,
-            BatchType::Counter => 2,
-        }
+  fn as_byte(&self) -> u8 {
+    match *self {
+      BatchType::Logged => 0,
+      BatchType::Unlogged => 1,
+      BatchType::Counter => 2,
     }
+  }
 }
 
 /// The structure that represents a query to be batched.
 #[derive(Debug, Clone)]
 pub struct BatchQuery {
-    /// It indicates if a query was prepared.
-    pub is_prepared: bool,
-    /// It contains either id of prepared query of a query itself.
-    pub subject: BatchQuerySubj,
-    /// It is the optional name of the following <value_i>. It must be present
-    /// if and only if the 0x40 flag is provided for the batch.
-    /// **Important note:** this feature does not work and should not be
-    /// used. It is specified in a way that makes it impossible for the server
-    /// to implement. This will be fixed in a future version of the native
-    /// protocol. See https://issues.apache.org/jira/browse/CASSANDRA-10246 for
-    /// more details
-    pub values: QueryValues,
+  /// It indicates if a query was prepared.
+  pub is_prepared: bool,
+  /// It contains either id of prepared query of a query itself.
+  pub subject: BatchQuerySubj,
+  /// It is the optional name of the following <value_i>. It must be present
+  /// if and only if the 0x40 flag is provided for the batch.
+  /// **Important note:** this feature does not work and should not be
+  /// used. It is specified in a way that makes it impossible for the server
+  /// to implement. This will be fixed in a future version of the native
+  /// protocol. See https://issues.apache.org/jira/browse/CASSANDRA-10246 for
+  /// more details
+  pub values: QueryValues,
 }
 
 /// It contains either an id of prepared query or CQL string.
 #[derive(Debug, Clone)]
 pub enum BatchQuerySubj {
-    PreparedId(CBytesShort),
-    QueryString(CStringLong),
+  PreparedId(CBytesShort),
+  QueryString(CStringLong),
 }
 
 impl IntoBytes for BatchQuery {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut bytes = vec![];
-
-        // kind
-        if self.is_prepared {
-            bytes.push(1);
-        } else {
-            bytes.push(0);
-        }
-
-        match self.subject {
-            BatchQuerySubj::PreparedId(ref s) => {
-                bytes.extend_from_slice(s.into_cbytes().as_slice());
-            }
-            BatchQuerySubj::QueryString(ref s) => {
-                bytes.extend_from_slice(s.into_cbytes().as_slice());
-            }
-        }
-
-        bytes.extend_from_slice(to_short(self.values.len() as i16).as_slice());
-
-        bytes.extend_from_slice(self.values.into_cbytes().as_slice());
-
-        bytes
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut bytes = vec![];
+
+    // kind
+    if self.is_prepared {
+      bytes.push(1);
+    } else {
+      bytes.push(0);
     }
+
+    match self.subject {
+      BatchQuerySubj::PreparedId(ref s) => {
+        bytes.extend_from_slice(s.into_cbytes().as_slice());
+      }
+      BatchQuerySubj::QueryString(ref s) => {
+        bytes.extend_from_slice(s.into_cbytes().as_slice());
+      }
+    }
+
+    bytes.extend_from_slice(to_short(self.values.len() as i16).as_slice());
+
+    bytes.extend_from_slice(self.values.into_cbytes().as_slice());
+
+    bytes
+  }
 }
 
 impl Frame {
-    /// **Note:** This function should be used internally for building query request frames.
-    pub fn new_req_batch(query: BodyReqBatch, flags: Vec<Flag>) -> Frame {
-        let version = Version::Request;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Batch;
-
-        Frame { version: version,
-                flags: flags,
-                stream: stream,
-                opcode: opcode,
-                body: query.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+  /// **Note:** This function should be used internally for building query request frames.
+  pub fn new_req_batch(query: BodyReqBatch, flags: Vec<Flag>) -> Frame {
+    let version = Version::Request;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Batch;
+
+    Frame {
+      version: version,
+      flags: flags,
+      stream: stream,
+      opcode: opcode,
+      body: query.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
diff --git a/src/frame/frame_error.rs b/src/frame/frame_error.rs
index dcd99c4..a2ecffc 100644
--- a/src/frame/frame_error.rs
+++ b/src/frame/frame_error.rs
@@ -5,11 +5,11 @@
 use std::io;
 use std::result;
 
-use error;
-use consistency::Consistency;
-use types::*;
-use frame::traits::FromCursor;
-use frame::Frame;
+use crate::consistency::Consistency;
+use crate::error;
+use crate::frame::traits::FromCursor;
+use crate::frame::Frame;
+use crate::types::*;
 
 /// CDRS specific `Result` which contains a [`Frame`] in case of `Ok` and `CDRSError` if `Err`.
 ///
@@ -22,24 +22,26 @@ pub type Result = result::Result<Frame, CDRSError>;
 /// This additional information is represented by `additional_info` property which is `ErrorKind`.
 #[derive(Debug)]
 pub struct CDRSError {
-    /// `i32` that points to a type of error.
-    pub error_code: CInt,
-    /// Error message string.
-    pub message: CString,
-    /// Additional information.
-    pub additional_info: AdditionalErrorInfo,
+  /// `i32` that points to a type of error.
+  pub error_code: CInt,
+  /// Error message string.
+  pub message: CString,
+  /// Additional information.
+  pub additional_info: AdditionalErrorInfo,
 }
 
 impl FromCursor for CDRSError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<CDRSError> {
-        let error_code = CInt::from_cursor(&mut cursor)?;
-        let message = CString::from_cursor(&mut cursor)?;
-        let additional_info = AdditionalErrorInfo::from_cursor_with_code(&mut cursor, error_code)?;
-
-        Ok(CDRSError { error_code: error_code,
-                       message: message,
-                       additional_info: additional_info, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<CDRSError> {
+    let error_code = CInt::from_cursor(&mut cursor)?;
+    let message = CString::from_cursor(&mut cursor)?;
+    let additional_info = AdditionalErrorInfo::from_cursor_with_code(&mut cursor, error_code)?;
+
+    Ok(CDRSError {
+      error_code: error_code,
+      message: message,
+      additional_info: additional_info,
+    })
+  }
 }
 
 /// Additional error info in accordance to
@@ -47,88 +49,89 @@ impl FromCursor for CDRSError {
 /// (https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L1011).
 #[derive(Debug)]
 pub enum AdditionalErrorInfo {
-    Server(SimpleError),
-    Protocol(SimpleError),
-    Authentication(SimpleError),
-    Unavailable(UnavailableError),
-    Overloaded(SimpleError),
-    IsBootstrapping(SimpleError),
-    Truncate(SimpleError),
-    WriteTimeout(WriteTimeoutError),
-    ReadTimeout(ReadTimeoutError),
-    ReadFailure(ReadFailureError),
-    FunctionFailure(FunctionFailureError),
-    WriteFailure(WriteFailureError),
-    Syntax(SimpleError),
-    Unauthorized(SimpleError),
-    Invalid(SimpleError),
-    Config(SimpleError),
-    AlreadyExists(AlreadyExistsError),
-    Unprepared(UnpreparedError),
+  Server(SimpleError),
+  Protocol(SimpleError),
+  Authentication(SimpleError),
+  Unavailable(UnavailableError),
+  Overloaded(SimpleError),
+  IsBootstrapping(SimpleError),
+  Truncate(SimpleError),
+  WriteTimeout(WriteTimeoutError),
+  ReadTimeout(ReadTimeoutError),
+  ReadFailure(ReadFailureError),
+  FunctionFailure(FunctionFailureError),
+  WriteFailure(WriteFailureError),
+  Syntax(SimpleError),
+  Unauthorized(SimpleError),
+  Invalid(SimpleError),
+  Config(SimpleError),
+  AlreadyExists(AlreadyExistsError),
+  Unprepared(UnpreparedError),
 }
 
 impl AdditionalErrorInfo {
-    pub fn from_cursor_with_code(mut cursor: &mut io::Cursor<&[u8]>,
-                                 error_code: CInt)
-                                 -> error::Result<AdditionalErrorInfo> {
-        match error_code {
-            0x0000 => Ok(AdditionalErrorInfo::Server(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x000A => Ok(AdditionalErrorInfo::Protocol(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x0100 => Ok(AdditionalErrorInfo::Authentication(
-                SimpleError::from_cursor(&mut cursor)?,
-            )),
-            0x1000 => Ok(AdditionalErrorInfo::Unavailable(
-                UnavailableError::from_cursor(&mut cursor)?,
-            )),
-            0x1001 => Ok(AdditionalErrorInfo::Overloaded(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x1002 => Ok(AdditionalErrorInfo::IsBootstrapping(
-                SimpleError::from_cursor(&mut cursor)?,
-            )),
-            0x1003 => Ok(AdditionalErrorInfo::Truncate(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x1100 => Ok(AdditionalErrorInfo::WriteTimeout(
-                WriteTimeoutError::from_cursor(&mut cursor)?,
-            )),
-            0x1200 => Ok(AdditionalErrorInfo::ReadTimeout(
-                ReadTimeoutError::from_cursor(&mut cursor)?,
-            )),
-            0x1300 => Ok(AdditionalErrorInfo::ReadFailure(
-                ReadFailureError::from_cursor(&mut cursor)?,
-            )),
-            0x1400 => Ok(AdditionalErrorInfo::FunctionFailure(
-                FunctionFailureError::from_cursor(&mut cursor)?,
-            )),
-            0x1500 => Ok(AdditionalErrorInfo::WriteFailure(
-                WriteFailureError::from_cursor(&mut cursor)?,
-            )),
-            0x2000 => Ok(AdditionalErrorInfo::Syntax(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x2100 => Ok(AdditionalErrorInfo::Unauthorized(
-                SimpleError::from_cursor(&mut cursor)?,
-            )),
-            0x2200 => Ok(AdditionalErrorInfo::Invalid(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x2300 => Ok(AdditionalErrorInfo::Config(SimpleError::from_cursor(
-                &mut cursor,
-            )?)),
-            0x2400 => Ok(AdditionalErrorInfo::AlreadyExists(
-                AlreadyExistsError::from_cursor(&mut cursor)?,
-            )),
-            0x2500 => Ok(AdditionalErrorInfo::Unprepared(
-                UnpreparedError::from_cursor(&mut cursor)?,
-            )),
-            _ => Err("Unexpected additional error info".into()),
-        }
+  pub fn from_cursor_with_code(
+    mut cursor: &mut io::Cursor<&[u8]>,
+    error_code: CInt,
+  ) -> error::Result<AdditionalErrorInfo> {
+    match error_code {
+      0x0000 => Ok(AdditionalErrorInfo::Server(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x000A => Ok(AdditionalErrorInfo::Protocol(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x0100 => Ok(AdditionalErrorInfo::Authentication(
+        SimpleError::from_cursor(&mut cursor)?,
+      )),
+      0x1000 => Ok(AdditionalErrorInfo::Unavailable(
+        UnavailableError::from_cursor(&mut cursor)?,
+      )),
+      0x1001 => Ok(AdditionalErrorInfo::Overloaded(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x1002 => Ok(AdditionalErrorInfo::IsBootstrapping(
+        SimpleError::from_cursor(&mut cursor)?,
+      )),
+      0x1003 => Ok(AdditionalErrorInfo::Truncate(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x1100 => Ok(AdditionalErrorInfo::WriteTimeout(
+        WriteTimeoutError::from_cursor(&mut cursor)?,
+      )),
+      0x1200 => Ok(AdditionalErrorInfo::ReadTimeout(
+        ReadTimeoutError::from_cursor(&mut cursor)?,
+      )),
+      0x1300 => Ok(AdditionalErrorInfo::ReadFailure(
+        ReadFailureError::from_cursor(&mut cursor)?,
+      )),
+      0x1400 => Ok(AdditionalErrorInfo::FunctionFailure(
+        FunctionFailureError::from_cursor(&mut cursor)?,
+      )),
+      0x1500 => Ok(AdditionalErrorInfo::WriteFailure(
+        WriteFailureError::from_cursor(&mut cursor)?,
+      )),
+      0x2000 => Ok(AdditionalErrorInfo::Syntax(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x2100 => Ok(AdditionalErrorInfo::Unauthorized(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x2200 => Ok(AdditionalErrorInfo::Invalid(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x2300 => Ok(AdditionalErrorInfo::Config(SimpleError::from_cursor(
+        &mut cursor,
+      )?)),
+      0x2400 => Ok(AdditionalErrorInfo::AlreadyExists(
+        AlreadyExistsError::from_cursor(&mut cursor)?,
+      )),
+      0x2500 => Ok(AdditionalErrorInfo::Unprepared(
+        UnpreparedError::from_cursor(&mut cursor)?,
+      )),
+      _ => Err("Unexpected additional error info".into()),
     }
+  }
 }
 
 /// Is used if error does not contain any additional info.
@@ -136,9 +139,9 @@ impl AdditionalErrorInfo {
 pub struct SimpleError {}
 
 impl FromCursor for SimpleError {
-    fn from_cursor(mut _cursor: &mut io::Cursor<&[u8]>) -> error::Result<SimpleError> {
-        Ok(SimpleError {})
-    }
+  fn from_cursor(mut _cursor: &mut io::Cursor<&[u8]>) -> error::Result<SimpleError> {
+    Ok(SimpleError {})
+  }
 }
 
 /// Additional info about
@@ -146,231 +149,243 @@ impl FromCursor for SimpleError {
 /// (https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L1025)
 #[derive(Debug)]
 pub struct UnavailableError {
-    /// Consistency level of query.
-    pub cl: Consistency,
-    /// Number of nodes that should be available to respect `cl`.
-    pub required: CInt,
-    /// Number of replicas that we were know to be alive.
-    pub alive: CInt,
+  /// Consistency level of query.
+  pub cl: Consistency,
+  /// Number of nodes that should be available to respect `cl`.
+  pub required: CInt,
+  /// Number of replicas that we were know to be alive.
+  pub alive: CInt,
 }
 
 impl FromCursor for UnavailableError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<UnavailableError> {
-        let cl = Consistency::from_cursor(&mut cursor)?;
-        let required = CInt::from_cursor(&mut cursor)?;
-        let alive = CInt::from_cursor(&mut cursor)?;
-
-        Ok(UnavailableError { cl: cl,
-                              required: required,
-                              alive: alive, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<UnavailableError> {
+    let cl = Consistency::from_cursor(&mut cursor)?;
+    let required = CInt::from_cursor(&mut cursor)?;
+    let alive = CInt::from_cursor(&mut cursor)?;
+
+    Ok(UnavailableError {
+      cl: cl,
+      required: required,
+      alive: alive,
+    })
+  }
 }
 
 /// Timeout exception during a write request.
 #[derive(Debug)]
 pub struct WriteTimeoutError {
-    /// Consistency level of query.
-    pub cl: Consistency,
-    /// `i32` representing the number of nodes having acknowledged the request.
-    pub received: CInt,
-    /// `i32` representing the number of replicas whose acknowledgement is required to achieve `cl`.
-    pub blockfor: CInt,
-    /// Describes the type of the write that timed out
-    pub write_type: WriteType,
+  /// Consistency level of query.
+  pub cl: Consistency,
+  /// `i32` representing the number of nodes having acknowledged the request.
+  pub received: CInt,
+  /// `i32` representing the number of replicas whose acknowledgement is required to achieve `cl`.
+  pub blockfor: CInt,
+  /// Describes the type of the write that timed out
+  pub write_type: WriteType,
 }
 
 impl FromCursor for WriteTimeoutError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<WriteTimeoutError> {
-        let cl = Consistency::from_cursor(&mut cursor)?;
-        let received = CInt::from_cursor(&mut cursor)?;
-        let blockfor = CInt::from_cursor(&mut cursor)?;
-        let write_type = WriteType::from_cursor(&mut cursor)?;
-
-        Ok(WriteTimeoutError { cl: cl,
-                               received: received,
-                               blockfor: blockfor,
-                               write_type: write_type, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<WriteTimeoutError> {
+    let cl = Consistency::from_cursor(&mut cursor)?;
+    let received = CInt::from_cursor(&mut cursor)?;
+    let blockfor = CInt::from_cursor(&mut cursor)?;
+    let write_type = WriteType::from_cursor(&mut cursor)?;
+
+    Ok(WriteTimeoutError {
+      cl: cl,
+      received: received,
+      blockfor: blockfor,
+      write_type: write_type,
+    })
+  }
 }
 
 /// Timeout exception during a read request.
 #[derive(Debug)]
 pub struct ReadTimeoutError {
-    /// Consistency level of query.
-    pub cl: Consistency,
-    /// `i32` representing the number of nodes having acknowledged the request.
-    pub received: CInt,
-    /// `i32` representing the number of replicas whose acknowledgement is required to achieve `cl`.
-    pub blockfor: CInt,
-    data_present: u8,
+  /// Consistency level of query.
+  pub cl: Consistency,
+  /// `i32` representing the number of nodes having acknowledged the request.
+  pub received: CInt,
+  /// `i32` representing the number of replicas whose acknowledgement is required to achieve `cl`.
+  pub blockfor: CInt,
+  data_present: u8,
 }
 
 impl ReadTimeoutError {
-    /// Shows if replica has resonded to a query.
-    pub fn replica_has_responded(&self) -> bool {
-        self.data_present != 0
-    }
+  /// Shows if replica has resonded to a query.
+  pub fn replica_has_responded(&self) -> bool {
+    self.data_present != 0
+  }
 }
 
 impl FromCursor for ReadTimeoutError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<ReadTimeoutError> {
-        let cl = Consistency::from_cursor(&mut cursor)?;
-        let received = CInt::from_cursor(&mut cursor)?;
-        let blockfor = CInt::from_cursor(&mut cursor)?;
-        let data_present = try_from_bytes(cursor_next_value(&mut cursor, 1)?.as_slice())? as u8;
-
-        Ok(ReadTimeoutError { cl: cl,
-                              received: received,
-                              blockfor: blockfor,
-                              data_present: data_present, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<ReadTimeoutError> {
+    let cl = Consistency::from_cursor(&mut cursor)?;
+    let received = CInt::from_cursor(&mut cursor)?;
+    let blockfor = CInt::from_cursor(&mut cursor)?;
+    let data_present = try_from_bytes(cursor_next_value(&mut cursor, 1)?.as_slice())? as u8;
+
+    Ok(ReadTimeoutError {
+      cl: cl,
+      received: received,
+      blockfor: blockfor,
+      data_present: data_present,
+    })
+  }
 }
 
 /// A non-timeout exception during a read request.
 #[derive(Debug)]
 pub struct ReadFailureError {
-    /// Consistency level of query.
-    pub cl: Consistency,
-    /// `i32` representing the number of nodes having acknowledged the request.
-    pub received: CInt,
-    /// `i32` representing the number of replicas whose acknowledgement is required to achieve `cl`.
-    pub blockfor: CInt,
-    /// Represents the number of nodes that experience a failure while executing the request.
-    pub num_failures: CInt,
-    data_present: u8,
+  /// Consistency level of query.
+  pub cl: Consistency,
+  /// `i32` representing the number of nodes having acknowledged the request.
+  pub received: CInt,
+  /// `i32` representing the number of replicas whose acknowledgement is required to achieve `cl`.
+  pub blockfor: CInt,
+  /// Represents the number of nodes that experience a failure while executing the request.
+  pub num_failures: CInt,
+  data_present: u8,
 }
 
 impl ReadFailureError {
-    /// Shows if replica has resonded to a query.
-    pub fn replica_has_responded(&self) -> bool {
-        self.data_present != 0
-    }
+  /// Shows if replica has resonded to a query.
+  pub fn replica_has_responded(&self) -> bool {
+    self.data_present != 0
+  }
 }
 
 impl FromCursor for ReadFailureError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<ReadFailureError> {
-        let cl = Consistency::from_cursor(&mut cursor)?;
-        let received = CInt::from_cursor(&mut cursor)?;
-        let blockfor = CInt::from_cursor(&mut cursor)?;
-        let num_failures = CInt::from_cursor(&mut cursor)?;
-        let data_present = try_from_bytes(cursor_next_value(&mut cursor, 1)?.as_slice())? as u8;
-
-        Ok(ReadFailureError { cl: cl,
-                              received: received,
-                              blockfor: blockfor,
-                              num_failures: num_failures,
-                              data_present: data_present, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<ReadFailureError> {
+    let cl = Consistency::from_cursor(&mut cursor)?;
+    let received = CInt::from_cursor(&mut cursor)?;
+    let blockfor = CInt::from_cursor(&mut cursor)?;
+    let num_failures = CInt::from_cursor(&mut cursor)?;
+    let data_present = try_from_bytes(cursor_next_value(&mut cursor, 1)?.as_slice())? as u8;
+
+    Ok(ReadFailureError {
+      cl: cl,
+      received: received,
+      blockfor: blockfor,
+      num_failures: num_failures,
+      data_present: data_present,
+    })
+  }
 }
 
 /// A (user defined) function failed during execution.
 #[derive(Debug)]
 pub struct FunctionFailureError {
-    /// The keyspace of the failed function.
-    pub keyspace: CString,
-    /// The name of the failed function
-    pub function: CString,
-    /// `Vec<CString>` one string for each argument type (as CQL type) of the failed function.
-    pub arg_types: CStringList,
+  /// The keyspace of the failed function.
+  pub keyspace: CString,
+  /// The name of the failed function
+  pub function: CString,
+  /// `Vec<CString>` one string for each argument type (as CQL type) of the failed function.
+  pub arg_types: CStringList,
 }
 
 impl FromCursor for FunctionFailureError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<FunctionFailureError> {
-        let keyspace = CString::from_cursor(&mut cursor)?;
-        let function = CString::from_cursor(&mut cursor)?;
-        let arg_types = CStringList::from_cursor(&mut cursor)?;
-
-        Ok(FunctionFailureError { keyspace: keyspace,
-                                  function: function,
-                                  arg_types: arg_types, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<FunctionFailureError> {
+    let keyspace = CString::from_cursor(&mut cursor)?;
+    let function = CString::from_cursor(&mut cursor)?;
+    let arg_types = CStringList::from_cursor(&mut cursor)?;
+
+    Ok(FunctionFailureError {
+      keyspace: keyspace,
+      function: function,
+      arg_types: arg_types,
+    })
+  }
 }
 
 /// A non-timeout exception during a write request.
 /// [Read more...](https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L1106)
 #[derive(Debug)]
 pub struct WriteFailureError {
-    /// Consistency of the query having triggered the exception.
-    pub cl: Consistency,
-    /// Represents the number of nodes having answered the request.
-    pub received: CInt,
-    /// Represents the number of replicas whose acknowledgement is required to achieve `cl`.
-    pub blockfor: CInt,
-    /// Represents the number of nodes that experience a failure while executing the request.
-    pub num_failures: CInt,
-    /// describes the type of the write that failed.
-    pub write_type: WriteType,
+  /// Consistency of the query having triggered the exception.
+  pub cl: Consistency,
+  /// Represents the number of nodes having answered the request.
+  pub received: CInt,
+  /// Represents the number of replicas whose acknowledgement is required to achieve `cl`.
+  pub blockfor: CInt,
+  /// Represents the number of nodes that experience a failure while executing the request.
+  pub num_failures: CInt,
+  /// describes the type of the write that failed.
+  pub write_type: WriteType,
 }
 
 impl FromCursor for WriteFailureError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<WriteFailureError> {
-        let cl = Consistency::from_cursor(&mut cursor)?;
-        let received = CInt::from_cursor(&mut cursor)?;
-        let blockfor = CInt::from_cursor(&mut cursor)?;
-        let num_failures = CInt::from_cursor(&mut cursor)?;
-        let write_type = WriteType::from_cursor(&mut cursor)?;
-
-        Ok(WriteFailureError { cl: cl,
-                               received: received,
-                               blockfor: blockfor,
-                               num_failures: num_failures,
-                               write_type: write_type, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<WriteFailureError> {
+    let cl = Consistency::from_cursor(&mut cursor)?;
+    let received = CInt::from_cursor(&mut cursor)?;
+    let blockfor = CInt::from_cursor(&mut cursor)?;
+    let num_failures = CInt::from_cursor(&mut cursor)?;
+    let write_type = WriteType::from_cursor(&mut cursor)?;
+
+    Ok(WriteFailureError {
+      cl: cl,
+      received: received,
+      blockfor: blockfor,
+      num_failures: num_failures,
+      write_type: write_type,
+    })
+  }
 }
 
 /// Describes the type of the write that failed.
 /// [Read more...](https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L1118)
 #[derive(Debug)]
 pub enum WriteType {
-    /// The write was a non-batched non-counter write
-    Simple,
-    /// The write was a (logged) batch write.
-    /// If this type is received, it means the batch log
-    /// has been successfully written
-    Batch,
-    /// The write was an unlogged batch. No batch log write has been attempted.
-    UnloggedBatch,
-    /// The write was a counter write (batched or not)
-    Counter,
-    /// The failure occured during the write to the batch log when a (logged) batch
-    /// write was requested.
-    BatchLog,
+  /// The write was a non-batched non-counter write
+  Simple,
+  /// The write was a (logged) batch write.
+  /// If this type is received, it means the batch log
+  /// has been successfully written
+  Batch,
+  /// The write was an unlogged batch. No batch log write has been attempted.
+  UnloggedBatch,
+  /// The write was a counter write (batched or not)
+  Counter,
+  /// The failure occured during the write to the batch log when a (logged) batch
+  /// write was requested.
+  BatchLog,
 }
 
 impl FromCursor for WriteType {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<WriteType> {
-        CString::from_cursor(&mut cursor).and_then(|wt| match wt.as_str() {
-                                                       "SIMPLE" => Ok(WriteType::Simple),
-                                                       "BATCH" => Ok(WriteType::Batch),
-                                                       "UNLOGGED_BATCH" => {
-                                                           Ok(WriteType::UnloggedBatch)
-                                                       }
-                                                       "COUNTER" => Ok(WriteType::Counter),
-                                                       "BATCH_LOG" => Ok(WriteType::BatchLog),
-                                                       _ => Err("Unexpected write type".into()),
-                                                   })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<WriteType> {
+    CString::from_cursor(&mut cursor).and_then(|wt| match wt.as_str() {
+      "SIMPLE" => Ok(WriteType::Simple),
+      "BATCH" => Ok(WriteType::Batch),
+      "UNLOGGED_BATCH" => Ok(WriteType::UnloggedBatch),
+      "COUNTER" => Ok(WriteType::Counter),
+      "BATCH_LOG" => Ok(WriteType::BatchLog),
+      _ => Err("Unexpected write type".into()),
+    })
+  }
 }
 
 /// The query attempted to create a keyspace or a table that was already existing.
 /// [Read more...](https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L1140)
 #[derive(Debug)]
 pub struct AlreadyExistsError {
-    /// Represents either the keyspace that already exists,
-    /// or the keyspace in which the table that already exists is.
-    pub ks: CString,
-    /// Represents the name of the table that already exists.
-    pub table: CString,
+  /// Represents either the keyspace that already exists,
+  /// or the keyspace in which the table that already exists is.
+  pub ks: CString,
+  /// Represents the name of the table that already exists.
+  pub table: CString,
 }
 
 impl FromCursor for AlreadyExistsError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<AlreadyExistsError> {
-        let ks = CString::from_cursor(&mut cursor)?;
-        let table = CString::from_cursor(&mut cursor)?;
-
-        Ok(AlreadyExistsError { ks: ks,
-                                table: table, })
-    }
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<AlreadyExistsError> {
+    let ks = CString::from_cursor(&mut cursor)?;
+    let table = CString::from_cursor(&mut cursor)?;
+
+    Ok(AlreadyExistsError {
+      ks: ks,
+      table: table,
+    })
+  }
 }
 
 /// Can be thrown while a prepared statement tries to be
@@ -379,14 +394,14 @@ impl FromCursor for AlreadyExistsError {
 /// (https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L1150)
 #[derive(Debug)]
 pub struct UnpreparedError {
-    /// Unknown ID.
-    pub id: CBytesShort,
+  /// Unknown ID.
+  pub id: CBytesShort,
 }
 
 impl FromCursor for UnpreparedError {
-    fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<UnpreparedError> {
-        let id = CBytesShort::from_cursor(&mut cursor)?;
+  fn from_cursor(mut cursor: &mut io::Cursor<&[u8]>) -> error::Result<UnpreparedError> {
+    let id = CBytesShort::from_cursor(&mut cursor)?;
 
-        Ok(UnpreparedError { id: id })
-    }
+    Ok(UnpreparedError { id: id })
+  }
 }
diff --git a/src/frame/frame_event.rs b/src/frame/frame_event.rs
index 7f6e088..31da6d4 100644
--- a/src/frame/frame_event.rs
+++ b/src/frame/frame_event.rs
@@ -1,80 +1,46 @@
 use std::io::Cursor;
 
-use frame::FromCursor;
-use error;
-use frame::events::ServerEvent;
+use crate::error;
+use crate::frame::events::ServerEvent;
+use crate::frame::FromCursor;
 
 #[derive(Debug)]
 pub struct BodyResEvent {
-    pub event: ServerEvent,
+  pub event: ServerEvent,
 }
 
 impl FromCursor for BodyResEvent {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> error::Result<BodyResEvent> {
-        let event = ServerEvent::from_cursor(&mut cursor)?;
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> error::Result<BodyResEvent> {
+    let event = ServerEvent::from_cursor(&mut cursor)?;
 
-        Ok(BodyResEvent { event: event })
-    }
+    Ok(BodyResEvent { event: event })
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use std::io::Cursor;
-    use frame::traits::FromCursor;
-    use frame::events::*;
+  use super::*;
+  use crate::frame::events::*;
+  use crate::frame::traits::FromCursor;
+  use std::io::Cursor;
 
-    #[test]
-    fn body_res_event() {
-        let bytes = [// TOPOLOGY_CHANGE
-                     0,
-                     15,
-                     84,
-                     79,
-                     80,
-                     79,
-                     76,
-                     79,
-                     71,
-                     89,
-                     95,
-                     67,
-                     72,
-                     65,
-                     78,
-                     71,
-                     69,
-                     // NEW_NODE
-                     0,
-                     8,
-                     78,
-                     69,
-                     87,
-                     95,
-                     78,
-                     79,
-                     68,
-                     69,
-                     // inet - 127.0.0.1:1
-                     0,
-                     4,
-                     127,
-                     0,
-                     0,
-                     1,
-                     0,
-                     0,
-                     0,
-                     1];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(&bytes);
-        let event = BodyResEvent::from_cursor(&mut cursor).unwrap().event;
+  #[test]
+  fn body_res_event() {
+    let bytes = [
+      // TOPOLOGY_CHANGE
+      0, 15, 84, 79, 80, 79, 76, 79, 71, 89, 95, 67, 72, 65, 78, 71, 69, // NEW_NODE
+      0, 8, 78, 69, 87, 95, 78, 79, 68, 69, // inet - 127.0.0.1:1
+      0, 4, 127, 0, 0, 1, 0, 0, 0, 1,
+    ];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(&bytes);
+    let event = BodyResEvent::from_cursor(&mut cursor).unwrap().event;
 
-        match event {
-            ServerEvent::TopologyChange(ref tc) => {
-                assert_eq!(tc.change_type, TopologyChangeType::NewNode);
-                assert_eq!(format!("{:?}", tc.addr.addr), "V4(127.0.0.1:1)");
-            }
-            _ => panic!("should be topology change event"),
-        }
+    match event {
+      ServerEvent::TopologyChange(ref tc) => {
+        assert_eq!(tc.change_type, TopologyChangeType::NewNode);
+        assert_eq!(format!("{:?}", tc.addr.addr), "V4(127.0.0.1:1)");
+      }
+      _ => panic!("should be topology change event"),
     }
+  }
 }
diff --git a/src/frame/frame_execute.rs b/src/frame/frame_execute.rs
index 366df12..da15a6e 100644
--- a/src/frame/frame_execute.rs
+++ b/src/frame/frame_execute.rs
@@ -1,55 +1,63 @@
 use rand;
-use types::*;
-use frame::*;
-use query::QueryParams;
+
+use crate::frame::*;
+use crate::query::QueryParams;
+use crate::types::*;
 
 /// The structure that represents a body of a frame of type `execute`.
 #[derive(Debug)]
 pub struct BodyReqExecute<'a> {
-    /// Id of prepared query
-    id: &'a CBytesShort,
-    /// Query paramaters which have the same meaning as one for `query`
-    /// TODO: clarify if it is QueryParams or its shortened variant
-    query_parameters: QueryParams,
+  /// Id of prepared query
+  id: &'a CBytesShort,
+  /// Query paramaters which have the same meaning as one for `query`
+  /// TODO: clarify if it is QueryParams or its shortened variant
+  query_parameters: QueryParams,
 }
 
 impl<'a> BodyReqExecute<'a> {
-    /// The method which creates new instance of `BodyReqExecute`
-    pub fn new(id: &CBytesShort, query_parameters: QueryParams) -> BodyReqExecute {
-        BodyReqExecute { id: id,
-                         query_parameters: query_parameters, }
+  /// The method which creates new instance of `BodyReqExecute`
+  pub fn new(id: &CBytesShort, query_parameters: QueryParams) -> BodyReqExecute {
+    BodyReqExecute {
+      id: id,
+      query_parameters: query_parameters,
     }
+  }
 }
 
 impl<'a> IntoBytes for BodyReqExecute<'a> {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v: Vec<u8> = vec![];
-        v.extend_from_slice(self.id.into_cbytes().as_slice());
-        v.extend_from_slice(self.query_parameters.into_cbytes().as_slice());
-        v
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v: Vec<u8> = vec![];
+    v.extend_from_slice(self.id.into_cbytes().as_slice());
+    v.extend_from_slice(self.query_parameters.into_cbytes().as_slice());
+    v
+  }
 }
 
 impl Frame {
-    /// **Note:** This function should be used internally for building query request frames.
-    pub fn new_req_execute(id: &CBytesShort,
-                           query_parameters: QueryParams,
-                           flags: Vec<Flag>)
-                           -> Frame {
-        let version = Version::Request;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Execute;
-        debug!("prepared statement id{:?} getting executed  with parameters  {:?}",
-               id, query_parameters);
-        let body = BodyReqExecute::new(id, query_parameters);
+  /// **Note:** This function should be used internally for building query request frames.
+  pub fn new_req_execute(
+    id: &CBytesShort,
+    query_parameters: QueryParams,
+    flags: Vec<Flag>,
+  ) -> Frame {
+    let version = Version::Request;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Execute;
+    debug!(
+      "prepared statement id{:?} getting executed with parameters {:?}",
+      id, query_parameters
+    );
+    let body = BodyReqExecute::new(id, query_parameters);
 
-        Frame { version: version,
-                flags: flags,
-                stream: stream,
-                opcode: opcode,
-                body: body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+    Frame {
+      version: version,
+      flags: flags,
+      stream: stream,
+      opcode: opcode,
+      body: body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
diff --git a/src/frame/frame_options.rs b/src/frame/frame_options.rs
index 9b08587..e75c31b 100644
--- a/src/frame/frame_options.rs
+++ b/src/frame/frame_options.rs
@@ -1,47 +1,50 @@
 use rand;
-use frame::*;
+
+use crate::frame::*;
 
 /// The structure which represents a body of a frame of type `options`.
 #[derive(Debug, Default)]
 pub struct BodyReqOptions;
 
 impl IntoBytes for BodyReqOptions {
-    fn into_cbytes(&self) -> Vec<u8> {
-        vec![]
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    vec![]
+  }
 }
 
 // Frame implementation related to BodyReqStartup
 
 impl Frame {
-    /// Creates new frame of type `options`.
-    pub fn new_req_options() -> Frame {
-        let version = Version::Request;
-        let flag = Flag::Ignore;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Options;
-        let body: BodyReqOptions = Default::default();
-
-        Frame { version: version,
-                flags: vec![flag],
-                stream: stream,
-                opcode: opcode,
-                body: body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+  /// Creates new frame of type `options`.
+  pub fn new_req_options() -> Frame {
+    let version = Version::Request;
+    let flag = Flag::Ignore;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Options;
+    let body: BodyReqOptions = Default::default();
+
+    Frame {
+      version: version,
+      flags: vec![flag],
+      stream: stream,
+      opcode: opcode,
+      body: body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-
-    #[test]
-    fn test_frame_options() {
-        let frame = Frame::new_req_options();
-        assert_eq!(frame.version, Version::Request);
-        assert_eq!(frame.opcode, Opcode::Options);
-        assert_eq!(frame.body, vec![]);
-    }
+  use super::*;
+
+  #[test]
+  fn test_frame_options() {
+    let frame = Frame::new_req_options();
+    assert_eq!(frame.version, Version::Request);
+    assert_eq!(frame.opcode, Opcode::Options);
+    assert_eq!(frame.body, vec![]);
+  }
 }
diff --git a/src/frame/frame_prepare.rs b/src/frame/frame_prepare.rs
index 14a1c38..77fb073 100644
--- a/src/frame/frame_prepare.rs
+++ b/src/frame/frame_prepare.rs
@@ -1,41 +1,46 @@
 use rand;
-use types::*;
-use frame::*;
+
+use crate::frame::*;
+use crate::types::*;
 
 /// Struct that represents a body of a frame of type `prepare`
 #[derive(Debug)]
 pub struct BodyReqPrepare {
-    query: CStringLong,
+  query: CStringLong,
 }
 
 impl BodyReqPrepare {
-    /// Creates new body of a frame of type `prepare` that prepares query `query`.
-    pub fn new(query: String) -> BodyReqPrepare {
-        BodyReqPrepare { query: CStringLong::new(query), }
+  /// Creates new body of a frame of type `prepare` that prepares query `query`.
+  pub fn new(query: String) -> BodyReqPrepare {
+    BodyReqPrepare {
+      query: CStringLong::new(query),
     }
+  }
 }
 
 impl IntoBytes for BodyReqPrepare {
-    fn into_cbytes(&self) -> Vec<u8> {
-        self.query.into_cbytes()
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    self.query.into_cbytes()
+  }
 }
 
 impl Frame {
-    /// **Note:** This function should be used internally for building query request frames.
-    pub fn new_req_prepare(query: String, flags: Vec<Flag>) -> Frame {
-        let version = Version::Request;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Prepare;
-        let body = BodyReqPrepare::new(query);
+  /// **Note:** This function should be used internally for building query request frames.
+  pub fn new_req_prepare(query: String, flags: Vec<Flag>) -> Frame {
+    let version = Version::Request;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Prepare;
+    let body = BodyReqPrepare::new(query);
 
-        Frame { version: version,
-                flags: flags,
-                stream: stream,
-                opcode: opcode,
-                body: body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+    Frame {
+      version: version,
+      flags: flags,
+      stream: stream,
+      opcode: opcode,
+      body: body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
diff --git a/src/frame/frame_query.rs b/src/frame/frame_query.rs
index 2a0e5ef..537e086 100644
--- a/src/frame/frame_query.rs
+++ b/src/frame/frame_query.rs
@@ -1,119 +1,132 @@
 #![warn(missing_docs)]
 //! Contains Query Frame related functionality.
 use rand;
-use frame::*;
-use consistency::Consistency;
-use types::*;
-use query::{Query, QueryFlags, QueryParams, QueryValues};
+
+use crate::consistency::Consistency;
+use crate::frame::*;
+use crate::query::{Query, QueryFlags, QueryParams, QueryValues};
+use crate::types::*;
 
 /// Structure which represents body of Query request
 #[derive(Debug)]
 pub struct BodyReqQuery {
-    /// Query string.
-    pub query: CStringLong,
-    /// Query parameters.
-    pub query_params: QueryParams,
+  /// Query string.
+  pub query: CStringLong,
+  /// Query parameters.
+  pub query_params: QueryParams,
 }
 
 impl BodyReqQuery {
-    // Fabric function that produces Query request body.
-    fn new(query: String,
-           consistency: Consistency,
-           values: Option<QueryValues>,
-           with_names: Option<bool>,
-           page_size: Option<i32>,
-           paging_state: Option<CBytes>,
-           serial_consistency: Option<Consistency>,
-           timestamp: Option<i64>)
-           -> BodyReqQuery {
-        // query flags
-        let mut flags: Vec<QueryFlags> = vec![];
-        if values.is_some() {
-            flags.push(QueryFlags::Value);
-        }
-        if with_names.unwrap_or(false) {
-            flags.push(QueryFlags::WithNamesForValues);
-        }
-        if page_size.is_some() {
-            flags.push(QueryFlags::PageSize);
-        }
-        if paging_state.is_some() {
-            flags.push(QueryFlags::WithPagingState);
-        }
-        if serial_consistency.is_some() {
-            flags.push(QueryFlags::WithSerialConsistency);
-        }
-        if timestamp.is_some() {
-            flags.push(QueryFlags::WithDefaultTimestamp);
-        }
+  // Fabric function that produces Query request body.
+  fn new(
+    query: String,
+    consistency: Consistency,
+    values: Option<QueryValues>,
+    with_names: Option<bool>,
+    page_size: Option<i32>,
+    paging_state: Option<CBytes>,
+    serial_consistency: Option<Consistency>,
+    timestamp: Option<i64>,
+  ) -> BodyReqQuery {
+    // query flags
+    let mut flags: Vec<QueryFlags> = vec![];
+    if values.is_some() {
+      flags.push(QueryFlags::Value);
+    }
+    if with_names.unwrap_or(false) {
+      flags.push(QueryFlags::WithNamesForValues);
+    }
+    if page_size.is_some() {
+      flags.push(QueryFlags::PageSize);
+    }
+    if paging_state.is_some() {
+      flags.push(QueryFlags::WithPagingState);
+    }
+    if serial_consistency.is_some() {
+      flags.push(QueryFlags::WithSerialConsistency);
+    }
+    if timestamp.is_some() {
+      flags.push(QueryFlags::WithDefaultTimestamp);
+    }
 
-        BodyReqQuery { query: CStringLong::new(query),
-                       query_params: QueryParams { consistency,
-                                                   flags,
-                                                   with_names,
-                                                   values,
-                                                   page_size,
-                                                   paging_state,
-                                                   serial_consistency,
-                                                   timestamp, }, }
+    BodyReqQuery {
+      query: CStringLong::new(query),
+      query_params: QueryParams {
+        consistency,
+        flags,
+        with_names,
+        values,
+        page_size,
+        paging_state,
+        serial_consistency,
+        timestamp,
+      },
     }
+  }
 }
 
 impl IntoBytes for BodyReqQuery {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v: Vec<u8> = vec![];
-        v.extend_from_slice(self.query.clone().into_cbytes().as_slice());
-        v.extend_from_slice(self.query_params.into_cbytes().as_slice());
-        v
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v: Vec<u8> = vec![];
+    v.extend_from_slice(self.query.clone().into_cbytes().as_slice());
+    v.extend_from_slice(self.query_params.into_cbytes().as_slice());
+    v
+  }
 }
 
 // Frame implementation related to BodyReqStartup
 
 impl Frame {
-    /// **Note:** This function should be used internally for building query request frames.
-    pub fn new_req_query(query: String,
-                         consistency: Consistency,
-                         values: Option<QueryValues>,
-                         with_names: Option<bool>,
-                         page_size: Option<i32>,
-                         paging_state: Option<CBytes>,
-                         serial_consistency: Option<Consistency>,
-                         timestamp: Option<i64>,
-                         flags: Vec<Flag>)
-                         -> Frame {
-        let version = Version::Request;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Query;
-        let body = BodyReqQuery::new(query,
-                                     consistency,
-                                     values,
-                                     with_names,
-                                     page_size,
-                                     paging_state,
-                                     serial_consistency,
-                                     timestamp);
+  /// **Note:** This function should be used internally for building query request frames.
+  pub fn new_req_query(
+    query: String,
+    consistency: Consistency,
+    values: Option<QueryValues>,
+    with_names: Option<bool>,
+    page_size: Option<i32>,
+    paging_state: Option<CBytes>,
+    serial_consistency: Option<Consistency>,
+    timestamp: Option<i64>,
+    flags: Vec<Flag>,
+  ) -> Frame {
+    let version = Version::Request;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Query;
+    let body = BodyReqQuery::new(
+      query,
+      consistency,
+      values,
+      with_names,
+      page_size,
+      paging_state,
+      serial_consistency,
+      timestamp,
+    );
 
-        Frame { version: version,
-                flags: flags,
-                stream: stream,
-                opcode: opcode,
-                body: body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+    Frame {
+      version: version,
+      flags: flags,
+      stream: stream,
+      opcode: opcode,
+      body: body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 
-    /// **Note:** This function should be used internally for building query request frames.
-    pub fn new_query(query: Query, flags: Vec<Flag>) -> Frame {
-        Frame::new_req_query(query.query,
-                             query.params.consistency,
-                             query.params.values,
-                             query.params.with_names,
-                             query.params.page_size,
-                             query.params.paging_state,
-                             query.params.serial_consistency,
-                             query.params.timestamp,
-                             flags)
-    }
+  /// **Note:** This function should be used internally for building query request frames.
+  pub fn new_query(query: Query, flags: Vec<Flag>) -> Frame {
+    Frame::new_req_query(
+      query.query,
+      query.params.consistency,
+      query.params.values,
+      query.params.with_names,
+      query.params.page_size,
+      query.params.paging_state,
+      query.params.serial_consistency,
+      query.params.timestamp,
+      flags,
+    )
+  }
 }
diff --git a/src/frame/frame_ready.rs b/src/frame/frame_ready.rs
index c955e05..cf27154 100644
--- a/src/frame/frame_ready.rs
+++ b/src/frame/frame_ready.rs
@@ -1,42 +1,42 @@
 use std::convert::From;
 
-use frame::IntoBytes;
+use crate::frame::IntoBytes;
 
 #[derive(Debug, PartialEq, Default)]
 pub struct BodyResReady;
 
 impl From<Vec<u8>> for BodyResReady {
-    fn from(_vec: Vec<u8>) -> BodyResReady {
-        BodyResReady {}
-    }
+  fn from(_vec: Vec<u8>) -> BodyResReady {
+    BodyResReady {}
+  }
 }
 
 impl IntoBytes for BodyResReady {
-    fn into_cbytes(&self) -> Vec<u8> {
-        vec![]
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    vec![]
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use frame::traits::IntoBytes;
-
-    #[test]
-    fn body_res_ready_new() {
-        let body: BodyResReady = Default::default();
-        assert_eq!(body, BodyResReady {});
-    }
-
-    #[test]
-    fn body_res_ready_into_cbytes() {
-        let body = BodyResReady {};
-        assert_eq!(body.into_cbytes(), vec![] as Vec<u8>);
-    }
-
-    #[test]
-    fn body_res_ready_from() {
-        let body = BodyResReady::from(vec![]);
-        assert_eq!(body, BodyResReady {});
-    }
+  use super::*;
+  use crate::frame::traits::IntoBytes;
+
+  #[test]
+  fn body_res_ready_new() {
+    let body: BodyResReady = Default::default();
+    assert_eq!(body, BodyResReady {});
+  }
+
+  #[test]
+  fn body_res_ready_into_cbytes() {
+    let body = BodyResReady {};
+    assert_eq!(body.into_cbytes(), vec![] as Vec<u8>);
+  }
+
+  #[test]
+  fn body_res_ready_from() {
+    let body = BodyResReady::from(vec![]);
+    assert_eq!(body, BodyResReady {});
+  }
 }
diff --git a/src/frame/frame_register.rs b/src/frame/frame_register.rs
index 3f48498..4ea1827 100644
--- a/src/frame/frame_register.rs
+++ b/src/frame/frame_register.rs
@@ -1,41 +1,47 @@
 use rand;
-use frame::*;
-use frame::events::SimpleServerEvent;
-use types::{CString, CStringList};
+
+use crate::frame::events::SimpleServerEvent;
+use crate::frame::*;
+use crate::types::{CString, CStringList};
 
 /// The structure which represents a body of a frame of type `options`.
 pub struct BodyReqRegister {
-    pub events: Vec<SimpleServerEvent>,
+  pub events: Vec<SimpleServerEvent>,
 }
 
 impl IntoBytes for BodyReqRegister {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let events_string_list =
-            CStringList { list: self.events.iter()
-                                    .map(|event| CString::new(event.as_string()))
-                                    .collect(), };
-        events_string_list.into_cbytes()
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    let events_string_list = CStringList {
+      list: self
+        .events
+        .iter()
+        .map(|event| CString::new(event.as_string()))
+        .collect(),
+    };
+    events_string_list.into_cbytes()
+  }
 }
 
 // Frame implementation related to BodyReqRegister
 
 impl Frame {
-    /// Creates new frame of type `REGISTER`.
-    pub fn new_req_register(events: Vec<SimpleServerEvent>) -> Frame {
-        let version = Version::Request;
-        let flag = Flag::Ignore;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Register;
-        let register_body = BodyReqRegister { events: events };
+  /// Creates new frame of type `REGISTER`.
+  pub fn new_req_register(events: Vec<SimpleServerEvent>) -> Frame {
+    let version = Version::Request;
+    let flag = Flag::Ignore;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Register;
+    let register_body = BodyReqRegister { events: events };
 
-        Frame { version: version,
-                flags: vec![flag],
-                stream: stream,
-                opcode: opcode,
-                body: register_body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+    Frame {
+      version: version,
+      flags: vec![flag],
+      stream: stream,
+      opcode: opcode,
+      body: register_body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
diff --git a/src/frame/frame_response.rs b/src/frame/frame_response.rs
index 9e7dffa..7a1a271 100644
--- a/src/frame/frame_response.rs
+++ b/src/frame/frame_response.rs
@@ -1,127 +1,127 @@
 use std::io::Cursor;
 
-use frame::FromCursor;
-use error;
-use frame::Opcode;
-use frame::frame_result::{BodyResResultPrepared, BodyResResultRows, BodyResResultSetKeyspace,
-                          BodyResResultVoid, ResResultBody, RowsMetadata};
-use frame::frame_event::BodyResEvent;
-use frame::frame_error::CDRSError;
-use frame::frame_supported::*;
-use frame::frame_auth_challenge::*;
-use frame::frame_authenticate::BodyResAuthenticate;
-use frame::frame_auth_success::BodyReqAuthSuccess;
-use types::rows::Row;
+use crate::error;
+use crate::frame::frame_auth_challenge::*;
+use crate::frame::frame_auth_success::BodyReqAuthSuccess;
+use crate::frame::frame_authenticate::BodyResAuthenticate;
+use crate::frame::frame_error::CDRSError;
+use crate::frame::frame_event::BodyResEvent;
+use crate::frame::frame_result::{
+  BodyResResultPrepared, BodyResResultRows, BodyResResultSetKeyspace, BodyResResultVoid,
+  ResResultBody, RowsMetadata,
+};
+use crate::frame::frame_supported::*;
+use crate::frame::FromCursor;
+use crate::frame::Opcode;
+use crate::types::rows::Row;
 
 #[derive(Debug)]
 pub enum ResponseBody {
-    Error(CDRSError),
-    Startup,
-    Ready(BodyResResultVoid),
-    Authenticate(BodyResAuthenticate),
-    Options,
-    Supported(BodyResSupported),
-    Query,
-    Result(ResResultBody),
-    Prepare,
-    Execute,
-    Register,
-    Event(BodyResEvent),
-    Batch,
-    AuthChallenge(BodyResAuthChallenge),
-    AuthResponse,
-    AuthSuccess(BodyReqAuthSuccess),
+  Error(CDRSError),
+  Startup,
+  Ready(BodyResResultVoid),
+  Authenticate(BodyResAuthenticate),
+  Options,
+  Supported(BodyResSupported),
+  Query,
+  Result(ResResultBody),
+  Prepare,
+  Execute,
+  Register,
+  Event(BodyResEvent),
+  Batch,
+  AuthChallenge(BodyResAuthChallenge),
+  AuthResponse,
+  AuthSuccess(BodyReqAuthSuccess),
 }
 
 impl ResponseBody {
-    pub fn from(bytes: &[u8], response_type: &Opcode) -> error::Result<ResponseBody> {
-        let mut cursor: Cursor<&[u8]> = Cursor::new(bytes);
-        Ok(match *response_type {
-            // request frames
-            Opcode::Startup => unreachable!(),
-            Opcode::Options => unreachable!(),
-            Opcode::Query => unreachable!(),
-            Opcode::Prepare => unreachable!(),
-            Opcode::Execute => unreachable!(),
-            Opcode::Register => unreachable!(),
-            Opcode::Batch => unreachable!(),
-            Opcode::AuthResponse => unreachable!(),
+  pub fn from(bytes: &[u8], response_type: &Opcode) -> error::Result<ResponseBody> {
+    let mut cursor: Cursor<&[u8]> = Cursor::new(bytes);
+    Ok(match *response_type {
+      // request frames
+      Opcode::Startup => unreachable!(),
+      Opcode::Options => unreachable!(),
+      Opcode::Query => unreachable!(),
+      Opcode::Prepare => unreachable!(),
+      Opcode::Execute => unreachable!(),
+      Opcode::Register => unreachable!(),
+      Opcode::Batch => unreachable!(),
+      Opcode::AuthResponse => unreachable!(),
 
-            // response frames
-            Opcode::Error => ResponseBody::Error(CDRSError::from_cursor(&mut cursor)?),
-            Opcode::Ready => ResponseBody::Ready(BodyResResultVoid::from_cursor(&mut cursor)?),
-            Opcode::Authenticate => {
-                ResponseBody::Authenticate(BodyResAuthenticate::from_cursor(&mut cursor)?)
-            }
-            Opcode::Supported => {
-                ResponseBody::Supported(BodyResSupported::from_cursor(&mut cursor)?)
-            }
-            Opcode::Result => ResponseBody::Result(ResResultBody::from_cursor(&mut cursor)?),
-            Opcode::Event => ResponseBody::Event(BodyResEvent::from_cursor(&mut cursor)?),
-            Opcode::AuthChallenge => {
-                ResponseBody::AuthChallenge(BodyResAuthChallenge::from_cursor(&mut cursor)?)
-            }
-            Opcode::AuthSuccess => {
-                ResponseBody::AuthSuccess(BodyReqAuthSuccess::from_cursor(&mut cursor)?)
-            }
-        })
-    }
+      // response frames
+      Opcode::Error => ResponseBody::Error(CDRSError::from_cursor(&mut cursor)?),
+      Opcode::Ready => ResponseBody::Ready(BodyResResultVoid::from_cursor(&mut cursor)?),
+      Opcode::Authenticate => {
+        ResponseBody::Authenticate(BodyResAuthenticate::from_cursor(&mut cursor)?)
+      }
+      Opcode::Supported => ResponseBody::Supported(BodyResSupported::from_cursor(&mut cursor)?),
+      Opcode::Result => ResponseBody::Result(ResResultBody::from_cursor(&mut cursor)?),
+      Opcode::Event => ResponseBody::Event(BodyResEvent::from_cursor(&mut cursor)?),
+      Opcode::AuthChallenge => {
+        ResponseBody::AuthChallenge(BodyResAuthChallenge::from_cursor(&mut cursor)?)
+      }
+      Opcode::AuthSuccess => {
+        ResponseBody::AuthSuccess(BodyReqAuthSuccess::from_cursor(&mut cursor)?)
+      }
+    })
+  }
 
-    pub fn into_rows(self) -> Option<Vec<Row>> {
-        match self {
-            ResponseBody::Result(res) => res.into_rows(),
-            _ => None,
-        }
+  pub fn into_rows(self) -> Option<Vec<Row>> {
+    match self {
+      ResponseBody::Result(res) => res.into_rows(),
+      _ => None,
     }
+  }
 
-    pub fn as_rows_metadata(&self) -> Option<RowsMetadata> {
-        match *self {
-            ResponseBody::Result(ref res) => res.as_rows_metadata(),
-            _ => None,
-        }
+  pub fn as_rows_metadata(&self) -> Option<RowsMetadata> {
+    match *self {
+      ResponseBody::Result(ref res) => res.as_rows_metadata(),
+      _ => None,
     }
+  }
 
-    pub fn as_cols(&self) -> Option<&BodyResResultRows> {
-        match *self {
-            ResponseBody::Result(ref res) => match res {
-                &ResResultBody::Rows(ref rows) => Some(rows),
-                _ => None,
-            },
-            _ => None,
-        }
+  pub fn as_cols(&self) -> Option<&BodyResResultRows> {
+    match *self {
+      ResponseBody::Result(ref res) => match res {
+        &ResResultBody::Rows(ref rows) => Some(rows),
+        _ => None,
+      },
+      _ => None,
     }
+  }
 
-    /// It unwraps body and returns BodyResResultPrepared which contains an exact result of
-    /// PREPARE query. If frame body is not of type `Result` this method returns `None`.
-    pub fn into_prepared(self) -> Option<BodyResResultPrepared> {
-        match self {
-            ResponseBody::Result(res) => res.into_prepared(),
-            _ => None,
-        }
+  /// It unwraps body and returns BodyResResultPrepared which contains an exact result of
+  /// PREPARE query. If frame body is not of type `Result` this method returns `None`.
+  pub fn into_prepared(self) -> Option<BodyResResultPrepared> {
+    match self {
+      ResponseBody::Result(res) => res.into_prepared(),
+      _ => None,
     }
+  }
 
-    /// It unwraps body and returns BodyResResultPrepared which contains an exact result of
-    /// use keyspace query. If frame body is not of type `Result` this method returns `None`.
-    pub fn into_set_keyspace(self) -> Option<BodyResResultSetKeyspace> {
-        match self {
-            ResponseBody::Result(res) => res.into_set_keyspace(),
-            _ => None,
-        }
+  /// It unwraps body and returns BodyResResultPrepared which contains an exact result of
+  /// use keyspace query. If frame body is not of type `Result` this method returns `None`.
+  pub fn into_set_keyspace(self) -> Option<BodyResResultSetKeyspace> {
+    match self {
+      ResponseBody::Result(res) => res.into_set_keyspace(),
+      _ => None,
     }
+  }
 
-    /// It unwraps body and returns BodyResEvent.
-    /// If frame body is not of type `Result` this method returns `None`.
-    pub fn into_server_event(self) -> Option<BodyResEvent> {
-        match self {
-            ResponseBody::Event(event) => Some(event),
-            _ => None,
-        }
+  /// It unwraps body and returns BodyResEvent.
+  /// If frame body is not of type `Result` this method returns `None`.
+  pub fn into_server_event(self) -> Option<BodyResEvent> {
+    match self {
+      ResponseBody::Event(event) => Some(event),
+      _ => None,
     }
+  }
 
-    pub fn get_authenticator<'a>(&'a self) -> Option<&'a str> {
-        match *self {
-            ResponseBody::Authenticate(ref auth) => Some(auth.data.as_str()),
-            _ => None,
-        }
+  pub fn get_authenticator<'a>(&'a self) -> Option<&'a str> {
+    match *self {
+      ResponseBody::Authenticate(ref auth) => Some(auth.data.as_str()),
+      _ => None,
     }
+  }
 }
diff --git a/src/frame/frame_result.rs b/src/frame/frame_result.rs
index ce53852..4759adc 100644
--- a/src/frame/frame_result.rs
+++ b/src/frame/frame_result.rs
@@ -1,10 +1,10 @@
 use std::io::Cursor;
 
-use frame::{FromBytes, FromCursor, IntoBytes};
-use error;
-use types::*;
-use types::rows::Row;
-use frame::events::SchemaChange;
+use crate::frame::{FromBytes, FromCursor, IntoBytes};
+use crate::error;
+use crate::types::*;
+use crate::types::rows::Row;
+use crate::frame::events::SchemaChange;
 
 /// `ResultKind` is enum which represents types of result.
 #[derive(Debug)]
diff --git a/src/frame/frame_startup.rs b/src/frame/frame_startup.rs
index b217cda..cc24292 100644
--- a/src/frame/frame_startup.rs
+++ b/src/frame/frame_startup.rs
@@ -1,8 +1,9 @@
 use std::collections::HashMap;
 
 use rand;
-use frame::*;
-use types::to_short;
+
+use crate::frame::*;
+use crate::types::to_short;
 
 const CQL_VERSION: &'static str = "CQL_VERSION";
 const CQL_VERSION_VAL: &'static str = "3.0.0";
@@ -10,96 +11,98 @@ const COMPRESSION: &'static str = "COMPRESSION";
 
 #[derive(Debug)]
 pub struct BodyReqStartup<'a> {
-    pub map: HashMap<&'static str, &'a str>,
+  pub map: HashMap<&'static str, &'a str>,
 }
 
 impl<'a> BodyReqStartup<'a> {
-    pub fn new<'b>(compression: Option<&'b str>) -> BodyReqStartup<'b> {
-        let mut map = HashMap::new();
-        map.insert(CQL_VERSION, CQL_VERSION_VAL);
-        if let Some(c) = compression {
-            map.insert(COMPRESSION, c);
-        }
-        BodyReqStartup { map: map }
+  pub fn new<'b>(compression: Option<&'b str>) -> BodyReqStartup<'b> {
+    let mut map = HashMap::new();
+    map.insert(CQL_VERSION, CQL_VERSION_VAL);
+    if let Some(c) = compression {
+      map.insert(COMPRESSION, c);
     }
+    BodyReqStartup { map: map }
+  }
 
-    // should be [u8; 2]
-    // Number of key-value pairs
-    fn num(&self) -> Vec<u8> {
-        to_short(self.map.len() as i16)
-    }
+  // should be [u8; 2]
+  // Number of key-value pairs
+  fn num(&self) -> Vec<u8> {
+    to_short(self.map.len() as i16)
+  }
 }
 
 impl<'a> IntoBytes for BodyReqStartup<'a> {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v = vec![];
-        // push number of key-value pairs
-        v.extend_from_slice(&self.num().as_slice());
-        for (key, val) in self.map.iter() {
-            // push key len
-            v.extend_from_slice(to_short(key.len() as i16).as_slice());
-            // push key itself
-            v.extend_from_slice(key.as_bytes());
-            // push val len
-            v.extend_from_slice(to_short(val.len() as i16).as_slice());
-            // push val itself
-            v.extend_from_slice(val.as_bytes());
-        }
-        v
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v = vec![];
+    // push number of key-value pairs
+    v.extend_from_slice(&self.num().as_slice());
+    for (key, val) in self.map.iter() {
+      // push key len
+      v.extend_from_slice(to_short(key.len() as i16).as_slice());
+      // push key itself
+      v.extend_from_slice(key.as_bytes());
+      // push val len
+      v.extend_from_slice(to_short(val.len() as i16).as_slice());
+      // push val itself
+      v.extend_from_slice(val.as_bytes());
     }
+    v
+  }
 }
 
 // Frame implementation related to BodyReqStartup
 
 impl Frame {
-    /// Creates new frame of type `startup`.
-    pub fn new_req_startup(compression: Option<&str>) -> Frame {
-        let version = Version::Request;
-        let flag = Flag::Ignore;
-        let stream = rand::random::<u16>();
-        let opcode = Opcode::Startup;
-        let body = BodyReqStartup::new(compression);
+  /// Creates new frame of type `startup`.
+  pub fn new_req_startup(compression: Option<&str>) -> Frame {
+    let version = Version::Request;
+    let flag = Flag::Ignore;
+    let stream = rand::random::<u16>();
+    let opcode = Opcode::Startup;
+    let body = BodyReqStartup::new(compression);
 
-        Frame { version: version,
-                flags: vec![flag],
-                stream: stream,
-                opcode: opcode,
-                body: body.into_cbytes(),
-                // for request frames it's always None
-                tracing_id: None,
-                warnings: vec![], }
+    Frame {
+      version: version,
+      flags: vec![flag],
+      stream: stream,
+      opcode: opcode,
+      body: body.into_cbytes(),
+      // for request frames it's always None
+      tracing_id: None,
+      warnings: vec![],
     }
+  }
 }
 
 #[cfg(test)]
 mod test {
-    use super::*;
-    use frame::{Flag, Frame, Opcode, Version};
+  use super::*;
+  use crate::frame::{Flag, Frame, Opcode, Version};
 
-    #[test]
-    fn new_body_req_startup_some_compression() {
-        let compression = "test_compression";
-        let body = BodyReqStartup::new(Some(compression));
-        assert_eq!(body.map.get("CQL_VERSION"), Some(&"3.0.0"));
-        assert_eq!(body.map.get("COMPRESSION"), Some(&compression));
-        assert_eq!(body.map.len(), 2);
-    }
+  #[test]
+  fn new_body_req_startup_some_compression() {
+    let compression = "test_compression";
+    let body = BodyReqStartup::new(Some(compression));
+    assert_eq!(body.map.get("CQL_VERSION"), Some(&"3.0.0"));
+    assert_eq!(body.map.get("COMPRESSION"), Some(&compression));
+    assert_eq!(body.map.len(), 2);
+  }
 
-    #[test]
-    fn new_body_req_startup_none_compression() {
-        let body = BodyReqStartup::new(None);
-        assert_eq!(body.map.get("CQL_VERSION"), Some(&"3.0.0"));
-        assert_eq!(body.map.len(), 1);
-    }
+  #[test]
+  fn new_body_req_startup_none_compression() {
+    let body = BodyReqStartup::new(None);
+    assert_eq!(body.map.get("CQL_VERSION"), Some(&"3.0.0"));
+    assert_eq!(body.map.len(), 1);
+  }
 
-    #[test]
-    fn new_req_startup() {
-        let compression = Some("test_compression");
-        let frame = Frame::new_req_startup(compression);
-        assert_eq!(frame.version, Version::Request);
-        assert_eq!(frame.flags, vec![Flag::Ignore]);
-        assert_eq!(frame.opcode, Opcode::Startup);
-        assert_eq!(frame.tracing_id, None);
-        assert_eq!(frame.warnings, vec![] as Vec<String>);
-    }
+  #[test]
+  fn new_req_startup() {
+    let compression = Some("test_compression");
+    let frame = Frame::new_req_startup(compression);
+    assert_eq!(frame.version, Version::Request);
+    assert_eq!(frame.flags, vec![Flag::Ignore]);
+    assert_eq!(frame.opcode, Opcode::Startup);
+    assert_eq!(frame.tracing_id, None);
+    assert_eq!(frame.warnings, vec![] as Vec<String>);
+  }
 }
diff --git a/src/frame/frame_supported.rs b/src/frame/frame_supported.rs
index a093947..50ae3e0 100644
--- a/src/frame/frame_supported.rs
+++ b/src/frame/frame_supported.rs
@@ -1,58 +1,48 @@
 use std::collections::HashMap;
 use std::io::Cursor;
 
-use frame::FromCursor;
-use error;
-use types::{cursor_next_value, try_from_bytes, CString, CStringList, SHORT_LEN};
+use crate::error;
+use crate::frame::FromCursor;
+use crate::types::{cursor_next_value, try_from_bytes, CString, CStringList, SHORT_LEN};
 
 #[derive(Debug)]
 pub struct BodyResSupported {
-    pub data: HashMap<String, Vec<String>>,
+  pub data: HashMap<String, Vec<String>>,
 }
 
 impl FromCursor for BodyResSupported {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> error::Result<BodyResSupported> {
-        let l =
-            try_from_bytes(cursor_next_value(&mut cursor, SHORT_LEN as u64)?.as_slice())? as usize;
-        let mut data: HashMap<String, Vec<String>> = HashMap::with_capacity(l);
-        for _ in 0..l {
-            let name = CString::from_cursor(&mut cursor)?.into_plain();
-            let val = CStringList::from_cursor(&mut cursor)?.into_plain();
-            data.insert(name, val);
-        }
-
-        Ok(BodyResSupported { data: data })
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> error::Result<BodyResSupported> {
+    let l = try_from_bytes(cursor_next_value(&mut cursor, SHORT_LEN as u64)?.as_slice())? as usize;
+    let mut data: HashMap<String, Vec<String>> = HashMap::with_capacity(l);
+    for _ in 0..l {
+      let name = CString::from_cursor(&mut cursor)?.into_plain();
+      let val = CStringList::from_cursor(&mut cursor)?.into_plain();
+      data.insert(name, val);
     }
+
+    Ok(BodyResSupported { data: data })
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use std::io::Cursor;
-    use frame::traits::FromCursor;
-    use super::*;
+  use super::*;
+  use crate::frame::traits::FromCursor;
+  use std::io::Cursor;
 
-    #[test]
-    fn test_name() {
-        let bytes = [0,
-                     1, // n options
-                     // 1-st option
-                     0,
-                     2,
-                     97,
-                     98, // key [string] "ab"
-                     0,
-                     2,
-                     0,
-                     1,
-                     97,
-                     0,
-                     1,
-                     98 /* value ["a", "b"] */];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(&bytes);
-        let options = BodyResSupported::from_cursor(&mut cursor).unwrap().data;
-        assert_eq!(options.len(), 1);
-        let option_ab = options.get(&"ab".to_string()).unwrap();
-        assert_eq!(option_ab[0], "a".to_string());
-        assert_eq!(option_ab[1], "b".to_string());
-    }
+  #[test]
+  fn test_name() {
+    let bytes = [
+      0, 1, // n options
+      // 1-st option
+      0, 2, 97, 98, // key [string] "ab"
+      0, 2, 0, 1, 97, 0, 1, 98, /* value ["a", "b"] */
+    ];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(&bytes);
+    let options = BodyResSupported::from_cursor(&mut cursor).unwrap().data;
+    assert_eq!(options.len(), 1);
+    let option_ab = options.get(&"ab".to_string()).unwrap();
+    assert_eq!(option_ab[0], "a".to_string());
+    assert_eq!(option_ab[1], "b".to_string());
+  }
 }
diff --git a/src/frame/mod.rs b/src/frame/mod.rs
index 13d3351..37073ca 100644
--- a/src/frame/mod.rs
+++ b/src/frame/mod.rs
@@ -1,8 +1,8 @@
 //! `frame` module contains general Frame functionality.
-use types::to_n_bytes;
-pub use frame::traits::*;
-use frame::frame_response::ResponseBody;
-use compression::Compression;
+use crate::compression::Compression;
+use crate::frame::frame_response::ResponseBody;
+pub use crate::frame::traits::*;
+use crate::types::to_n_bytes;
 use uuid::Uuid;
 
 /// Number of stream bytes in accordance to protocol.
@@ -31,450 +31,465 @@ pub mod frame_supported;
 pub mod parser;
 pub mod traits;
 
-use error;
+use crate::error;
 
 #[derive(Debug)]
 pub struct Frame {
-    pub version: Version,
-    pub flags: Vec<Flag>,
-    pub opcode: Opcode,
-    pub stream: u16,
-    pub body: Vec<u8>,
-    pub tracing_id: Option<Uuid>,
-    pub warnings: Vec<String>,
+  pub version: Version,
+  pub flags: Vec<Flag>,
+  pub opcode: Opcode,
+  pub stream: u16,
+  pub body: Vec<u8>,
+  pub tracing_id: Option<Uuid>,
+  pub warnings: Vec<String>,
 }
 
 impl Frame {
-    pub fn get_body(&self) -> error::Result<ResponseBody> {
-        ResponseBody::from(self.body.as_slice(), &self.opcode)
-    }
-
-    pub fn tracing_id(&self) -> &Option<Uuid> {
-        &self.tracing_id
-    }
-
-    pub fn warnings(&self) -> &Vec<String> {
-        &self.warnings
-    }
-
-    pub fn encode_with(self, compressor: Compression) -> error::Result<Vec<u8>> {
-        let mut v = vec![];
-
-        let version_bytes = self.version.as_byte();
-        let flag_bytes = Flag::many_to_cbytes(&self.flags);
-        let opcode_bytes = self.opcode.as_byte();
-        let encoded_body = try!(compressor.encode(self.body));
-        let body_len = encoded_body.len();
-
-        v.push(version_bytes);
-        v.push(flag_bytes);
-        v.extend_from_slice(to_n_bytes(self.stream as u64, STREAM_LEN).as_slice());
-        v.push(opcode_bytes);
-        v.extend_from_slice(to_n_bytes(body_len as u64, LENGTH_LEN).as_slice());
-        v.extend_from_slice(encoded_body.as_slice());
-
-        Ok(v)
-    }
+  pub fn get_body(&self) -> error::Result<ResponseBody> {
+    ResponseBody::from(self.body.as_slice(), &self.opcode)
+  }
+
+  pub fn tracing_id(&self) -> &Option<Uuid> {
+    &self.tracing_id
+  }
+
+  pub fn warnings(&self) -> &Vec<String> {
+    &self.warnings
+  }
+
+  pub fn encode_with(self, compressor: Compression) -> error::Result<Vec<u8>> {
+    let mut v = vec![];
+
+    let version_bytes = self.version.as_byte();
+    let flag_bytes = Flag::many_to_cbytes(&self.flags);
+    let opcode_bytes = self.opcode.as_byte();
+    let encoded_body = compressor.encode(self.body)?;
+    let body_len = encoded_body.len();
+
+    v.push(version_bytes);
+    v.push(flag_bytes);
+    v.extend_from_slice(to_n_bytes(self.stream as u64, STREAM_LEN).as_slice());
+    v.push(opcode_bytes);
+    v.extend_from_slice(to_n_bytes(body_len as u64, LENGTH_LEN).as_slice());
+    v.extend_from_slice(encoded_body.as_slice());
+
+    Ok(v)
+  }
 }
 
 impl<'a> IntoBytes for Frame {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v = vec![];
-
-        let version_bytes = self.version.as_byte();
-        let flag_bytes = Flag::many_to_cbytes(&self.flags);
-        let opcode_bytes = self.opcode.as_byte();
-        let body_len = self.body.len();
-
-        v.push(version_bytes);
-        v.push(flag_bytes);
-        v.extend_from_slice(to_n_bytes(self.stream as u64, STREAM_LEN).as_slice());
-        v.push(opcode_bytes);
-        v.extend_from_slice(to_n_bytes(body_len as u64, LENGTH_LEN).as_slice());
-        v.extend_from_slice(self.body.as_slice());
-
-        v
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v = vec![];
+
+    let version_bytes = self.version.as_byte();
+    let flag_bytes = Flag::many_to_cbytes(&self.flags);
+    let opcode_bytes = self.opcode.as_byte();
+    let body_len = self.body.len();
+
+    v.push(version_bytes);
+    v.push(flag_bytes);
+    v.extend_from_slice(to_n_bytes(self.stream as u64, STREAM_LEN).as_slice());
+    v.push(opcode_bytes);
+    v.extend_from_slice(to_n_bytes(body_len as u64, LENGTH_LEN).as_slice());
+    v.extend_from_slice(self.body.as_slice());
+
+    v
+  }
 }
 
 /// Frame's version
 #[derive(Debug, PartialEq)]
 pub enum Version {
-    Request,
-    Response,
+  Request,
+  Response,
 }
 
 impl Version {
-    /// Number of bytes that represent Cassandra frame's version.
-    pub const BYTE_LENGTH: usize = 1;
-
-    /// It returns an actual Cassandra request frame version that CDRS can work with.
-    /// This version is based on selected feature - on of `v3`, `v4` or `v5`.
-    fn request_version() -> u8 {
-        if cfg!(feature = "v3") {
-            0x03
-        } else if cfg!(feature = "v4") || cfg!(feature = "v5") {
-            0x04
-        } else {
-            panic!("{}",
-                   "Protocol version is not supported. CDRS should be run with protocol feature \
-                    set to v3, v4 or v5");
-        }
+  /// Number of bytes that represent Cassandra frame's version.
+  pub const BYTE_LENGTH: usize = 1;
+
+  /// It returns an actual Cassandra request frame version that CDRS can work with.
+  /// This version is based on selected feature - on of `v3`, `v4` or `v5`.
+  fn request_version() -> u8 {
+    if cfg!(feature = "v3") {
+      0x03
+    } else if cfg!(feature = "v4") || cfg!(feature = "v5") {
+      0x04
+    } else {
+      panic!(
+        "{}",
+        "Protocol version is not supported. CDRS should be run with protocol feature \
+         set to v3, v4 or v5"
+      );
     }
-
-    /// It returns an actual Cassandra response frame version that CDRS can work with.
-    /// This version is based on selected feature - on of `v3`, `v4` or `v5`.
-    fn response_version() -> u8 {
-        if cfg!(feature = "v3") {
-            0x83
-        } else if cfg!(feature = "v4") || cfg!(feature = "v5") {
-            0x84
-        } else {
-            panic!("{}",
-                   "Protocol version is not supported. CDRS should be run with protocol feature \
-                    set to v3, v4 or v5");
-        }
+  }
+
+  /// It returns an actual Cassandra response frame version that CDRS can work with.
+  /// This version is based on selected feature - on of `v3`, `v4` or `v5`.
+  fn response_version() -> u8 {
+    if cfg!(feature = "v3") {
+      0x83
+    } else if cfg!(feature = "v4") || cfg!(feature = "v5") {
+      0x84
+    } else {
+      panic!(
+        "{}",
+        "Protocol version is not supported. CDRS should be run with protocol feature \
+         set to v3, v4 or v5"
+      );
     }
+  }
 }
 
 impl AsByte for Version {
-    fn as_byte(&self) -> u8 {
-        match self {
-            &Version::Request => Version::request_version(),
-            &Version::Response => Version::response_version(),
-        }
+  fn as_byte(&self) -> u8 {
+    match self {
+      &Version::Request => Version::request_version(),
+      &Version::Response => Version::response_version(),
     }
+  }
 }
 
 impl From<Vec<u8>> for Version {
-    fn from(v: Vec<u8>) -> Version {
-        if v.len() != Self::BYTE_LENGTH {
-            error!("Unexpected Cassandra verion. Should has {} byte(-s), got {:?}",
-                   Self::BYTE_LENGTH,
-                   v);
-            panic!("Unexpected Cassandra verion. Should has {} byte(-s), got {:?}",
-                   Self::BYTE_LENGTH,
-                   v);
-        }
-        let version = v[0];
-        let req = Version::request_version();
-        let res = Version::response_version();
-
-        if version == req {
-            Version::Request
-        } else if version == res {
-            Version::Response
-        } else {
-            error!("Unexpected Cassandra version {:?}, either {:?} or {:?} is expected",
-                   version, req, res);
-            panic!("Unexpected Cassandra version {:?}, either {:?} or {:?} is expected",
-                   version, req, res);
-        }
+  fn from(v: Vec<u8>) -> Version {
+    if v.len() != Self::BYTE_LENGTH {
+      error!(
+        "Unexpected Cassandra verion. Should has {} byte(-s), got {:?}",
+        Self::BYTE_LENGTH,
+        v
+      );
+      panic!(
+        "Unexpected Cassandra verion. Should has {} byte(-s), got {:?}",
+        Self::BYTE_LENGTH,
+        v
+      );
+    }
+    let version = v[0];
+    let req = Version::request_version();
+    let res = Version::response_version();
+
+    if version == req {
+      Version::Request
+    } else if version == res {
+      Version::Response
+    } else {
+      error!(
+        "Unexpected Cassandra version {:?}, either {:?} or {:?} is expected",
+        version, req, res
+      );
+      panic!(
+        "Unexpected Cassandra version {:?}, either {:?} or {:?} is expected",
+        version, req, res
+      );
     }
+  }
 }
 
 /// Frame's flag
 // Is not implemented functionality. Only Igonore works for now
 #[derive(Debug, PartialEq)]
 pub enum Flag {
-    Compression,
-    Tracing,
-    CustomPayload,
-    Warning,
-    Ignore,
+  Compression,
+  Tracing,
+  CustomPayload,
+  Warning,
+  Ignore,
 }
 
 impl Flag {
-    /// Number of flag bytes in accordance to protocol.
-    const BYTE_LENGTH: usize = 1;
+  /// Number of flag bytes in accordance to protocol.
+  const BYTE_LENGTH: usize = 1;
 
-    /// It returns selected flags collection.
-    pub fn get_collection(flags: u8) -> Vec<Flag> {
-        let mut found_flags: Vec<Flag> = vec![];
-
-        if Flag::has_compression(flags) {
-            found_flags.push(Flag::Compression);
-        }
-
-        if Flag::has_tracing(flags) {
-            found_flags.push(Flag::Tracing);
-        }
-
-        if Flag::has_custom_payload(flags) {
-            found_flags.push(Flag::CustomPayload);
-        }
-
-        if Flag::has_warning(flags) {
-            found_flags.push(Flag::Warning);
-        }
-
-        found_flags
-    }
+  /// It returns selected flags collection.
+  pub fn get_collection(flags: u8) -> Vec<Flag> {
+    let mut found_flags: Vec<Flag> = vec![];
 
-    /// The method converts a serie of `Flag`-s into a single byte.
-    pub fn many_to_cbytes(flags: &Vec<Flag>) -> u8 {
-        flags.iter()
-             .fold(Flag::Ignore.as_byte(), |acc, f| {
-            acc | f.as_byte()
-        })
+    if Flag::has_compression(flags) {
+      found_flags.push(Flag::Compression);
     }
 
-    /// Indicates if flags contains `Flag::Compression`
-    pub fn has_compression(flags: u8) -> bool {
-        (flags & Flag::Compression.as_byte()) > 0
+    if Flag::has_tracing(flags) {
+      found_flags.push(Flag::Tracing);
     }
 
-    /// Indicates if flags contains `Flag::Tracing`
-    pub fn has_tracing(flags: u8) -> bool {
-        (flags & Flag::Tracing.as_byte()) > 0
+    if Flag::has_custom_payload(flags) {
+      found_flags.push(Flag::CustomPayload);
     }
 
-    /// Indicates if flags contains `Flag::CustomPayload`
-    pub fn has_custom_payload(flags: u8) -> bool {
-        (flags & Flag::CustomPayload.as_byte()) > 0
+    if Flag::has_warning(flags) {
+      found_flags.push(Flag::Warning);
     }
 
-    /// Indicates if flags contains `Flag::Warning`
-    pub fn has_warning(flags: u8) -> bool {
-        (flags & Flag::Warning.as_byte()) > 0
-    }
+    found_flags
+  }
+
+  /// The method converts a serie of `Flag`-s into a single byte.
+  pub fn many_to_cbytes(flags: &Vec<Flag>) -> u8 {
+    flags
+      .iter()
+      .fold(Flag::Ignore.as_byte(), |acc, f| acc | f.as_byte())
+  }
+
+  /// Indicates if flags contains `Flag::Compression`
+  pub fn has_compression(flags: u8) -> bool {
+    (flags & Flag::Compression.as_byte()) > 0
+  }
+
+  /// Indicates if flags contains `Flag::Tracing`
+  pub fn has_tracing(flags: u8) -> bool {
+    (flags & Flag::Tracing.as_byte()) > 0
+  }
+
+  /// Indicates if flags contains `Flag::CustomPayload`
+  pub fn has_custom_payload(flags: u8) -> bool {
+    (flags & Flag::CustomPayload.as_byte()) > 0
+  }
+
+  /// Indicates if flags contains `Flag::Warning`
+  pub fn has_warning(flags: u8) -> bool {
+    (flags & Flag::Warning.as_byte()) > 0
+  }
 }
 
 impl AsByte for Flag {
-    fn as_byte(&self) -> u8 {
-        match self {
-            &Flag::Compression => 0x01,
-            &Flag::Tracing => 0x02,
-            &Flag::CustomPayload => 0x04,
-            &Flag::Warning => 0x08,
-            &Flag::Ignore => 0x00,
-            // assuming that ingoring value whould be other than [0x01, 0x02, 0x04, 0x08]
-        }
+  fn as_byte(&self) -> u8 {
+    match self {
+      &Flag::Compression => 0x01,
+      &Flag::Tracing => 0x02,
+      &Flag::CustomPayload => 0x04,
+      &Flag::Warning => 0x08,
+      &Flag::Ignore => 0x00,
+      // assuming that ingoring value whould be other than [0x01, 0x02, 0x04, 0x08]
     }
+  }
 }
 
 impl From<u8> for Flag {
-    fn from(f: u8) -> Flag {
-        match f {
-            0x01 => Flag::Compression,
-            0x02 => Flag::Tracing,
-            0x04 => Flag::CustomPayload,
-            0x08 => Flag::Warning,
-            _ => Flag::Ignore, // ignore by specification
-        }
+  fn from(f: u8) -> Flag {
+    match f {
+      0x01 => Flag::Compression,
+      0x02 => Flag::Tracing,
+      0x04 => Flag::CustomPayload,
+      0x08 => Flag::Warning,
+      _ => Flag::Ignore, // ignore by specification
     }
+  }
 }
 
 #[derive(Debug, PartialEq)]
 pub enum Opcode {
-    Error,
-    Startup,
-    Ready,
-    Authenticate,
-    Options,
-    Supported,
-    Query,
-    Result,
-    Prepare,
-    Execute,
-    Register,
-    Event,
-    Batch,
-    AuthChallenge,
-    AuthResponse,
-    AuthSuccess,
+  Error,
+  Startup,
+  Ready,
+  Authenticate,
+  Options,
+  Supported,
+  Query,
+  Result,
+  Prepare,
+  Execute,
+  Register,
+  Event,
+  Batch,
+  AuthChallenge,
+  AuthResponse,
+  AuthSuccess,
 }
 
 impl Opcode {
-    // Number of opcode bytes in accordance to protocol.
-    pub const BYTE_LENGTH: usize = 1;
+  // Number of opcode bytes in accordance to protocol.
+  pub const BYTE_LENGTH: usize = 1;
 }
 
 impl AsByte for Opcode {
-    fn as_byte(&self) -> u8 {
-        match self {
-            &Opcode::Error => 0x00,
-            &Opcode::Startup => 0x01,
-            &Opcode::Ready => 0x02,
-            &Opcode::Authenticate => 0x03,
-            &Opcode::Options => 0x05,
-            &Opcode::Supported => 0x06,
-            &Opcode::Query => 0x07,
-            &Opcode::Result => 0x08,
-            &Opcode::Prepare => 0x09,
-            &Opcode::Execute => 0x0A,
-            &Opcode::Register => 0x0B,
-            &Opcode::Event => 0x0C,
-            &Opcode::Batch => 0x0D,
-            &Opcode::AuthChallenge => 0x0E,
-            &Opcode::AuthResponse => 0x0F,
-            &Opcode::AuthSuccess => 0x10,
-        }
+  fn as_byte(&self) -> u8 {
+    match self {
+      &Opcode::Error => 0x00,
+      &Opcode::Startup => 0x01,
+      &Opcode::Ready => 0x02,
+      &Opcode::Authenticate => 0x03,
+      &Opcode::Options => 0x05,
+      &Opcode::Supported => 0x06,
+      &Opcode::Query => 0x07,
+      &Opcode::Result => 0x08,
+      &Opcode::Prepare => 0x09,
+      &Opcode::Execute => 0x0A,
+      &Opcode::Register => 0x0B,
+      &Opcode::Event => 0x0C,
+      &Opcode::Batch => 0x0D,
+      &Opcode::AuthChallenge => 0x0E,
+      &Opcode::AuthResponse => 0x0F,
+      &Opcode::AuthSuccess => 0x10,
     }
+  }
 }
 
 impl From<u8> for Opcode {
-    fn from(b: u8) -> Opcode {
-        match b {
-            0x00 => Opcode::Error,
-            0x01 => Opcode::Startup,
-            0x02 => Opcode::Ready,
-            0x03 => Opcode::Authenticate,
-            0x05 => Opcode::Options,
-            0x06 => Opcode::Supported,
-            0x07 => Opcode::Query,
-            0x08 => Opcode::Result,
-            0x09 => Opcode::Prepare,
-            0x0A => Opcode::Execute,
-            0x0B => Opcode::Register,
-            0x0C => Opcode::Event,
-            0x0D => Opcode::Batch,
-            0x0E => Opcode::AuthChallenge,
-            0x0F => Opcode::AuthResponse,
-            0x10 => Opcode::AuthSuccess,
-            _ => unreachable!(),
-        }
+  fn from(b: u8) -> Opcode {
+    match b {
+      0x00 => Opcode::Error,
+      0x01 => Opcode::Startup,
+      0x02 => Opcode::Ready,
+      0x03 => Opcode::Authenticate,
+      0x05 => Opcode::Options,
+      0x06 => Opcode::Supported,
+      0x07 => Opcode::Query,
+      0x08 => Opcode::Result,
+      0x09 => Opcode::Prepare,
+      0x0A => Opcode::Execute,
+      0x0B => Opcode::Register,
+      0x0C => Opcode::Event,
+      0x0D => Opcode::Batch,
+      0x0E => Opcode::AuthChallenge,
+      0x0F => Opcode::AuthResponse,
+      0x10 => Opcode::AuthSuccess,
+      _ => unreachable!(),
     }
+  }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use frame::traits::AsByte;
-
-    #[test]
-    #[cfg(not(feature = "v3"))]
-    fn test_frame_version_as_byte() {
-        let request_version = Version::Request;
-        assert_eq!(request_version.as_byte(), 0x04);
-        let response_version = Version::Response;
-        assert_eq!(response_version.as_byte(), 0x84);
-    }
-
-    #[test]
-    #[cfg(feature = "v3")]
-    fn test_frame_version_as_byte_v3() {
-        let request_version = Version::Request;
-        assert_eq!(request_version.as_byte(), 0x03);
-        let response_version = Version::Response;
-        assert_eq!(response_version.as_byte(), 0x83);
-    }
-
-    #[test]
-    #[cfg(not(feature = "v3"))]
-    fn test_frame_version_from() {
-        let request: Vec<u8> = vec![0x04];
-        assert_eq!(Version::from(request), Version::Request);
-        let response: Vec<u8> = vec![0x84];
-        assert_eq!(Version::from(response), Version::Response);
-    }
-
-    #[test]
-    #[cfg(feature = "v3")]
-    fn test_frame_version_from_v3() {
-        let request: Vec<u8> = vec![0x03];
-        assert_eq!(Version::from(request), Version::Request);
-        let response: Vec<u8> = vec![0x83];
-        assert_eq!(Version::from(response), Version::Response);
-    }
-
-    #[test]
-    fn test_flag_from() {
-        assert_eq!(Flag::from(0x01 as u8), Flag::Compression);
-        assert_eq!(Flag::from(0x02 as u8), Flag::Tracing);
-        assert_eq!(Flag::from(0x04 as u8), Flag::CustomPayload);
-        assert_eq!(Flag::from(0x08 as u8), Flag::Warning);
-        // rest should be interpreted as Ignore
-        assert_eq!(Flag::from(0x10 as u8), Flag::Ignore);
-        assert_eq!(Flag::from(0x31 as u8), Flag::Ignore);
-    }
-
-    #[test]
-    fn test_flag_as_byte() {
-        assert_eq!(Flag::Compression.as_byte(), 0x01);
-        assert_eq!(Flag::Tracing.as_byte(), 0x02);
-        assert_eq!(Flag::CustomPayload.as_byte(), 0x04);
-        assert_eq!(Flag::Warning.as_byte(), 0x08);
-    }
-
-    #[test]
-    fn test_flag_has_x() {
-        assert!(Flag::has_compression(0x01));
-        assert!(!Flag::has_compression(0x02));
-
-        assert!(Flag::has_tracing(0x02));
-        assert!(!Flag::has_tracing(0x01));
-
-        assert!(Flag::has_custom_payload(0x04));
-        assert!(!Flag::has_custom_payload(0x02));
-
-        assert!(Flag::has_warning(0x08));
-        assert!(!Flag::has_warning(0x01));
-    }
-
-    #[test]
-    fn test_flag_many_to_cbytes() {
-        let all = vec![Flag::Compression,
-                       Flag::Tracing,
-                       Flag::CustomPayload,
-                       Flag::Warning];
-        assert_eq!(Flag::many_to_cbytes(&all), 1 | 2 | 4 | 8);
-        let some = vec![Flag::Compression, Flag::Warning];
-        assert_eq!(Flag::many_to_cbytes(&some), 1 | 8);
-        let one = vec![Flag::Compression];
-        assert_eq!(Flag::many_to_cbytes(&one), 1);
-    }
-
-    #[test]
-    fn test_flag_get_collection() {
-        let all = vec![Flag::Compression,
-                       Flag::Tracing,
-                       Flag::CustomPayload,
-                       Flag::Warning];
-        assert_eq!(Flag::get_collection(1 | 2 | 4 | 8), all);
-        let some = vec![Flag::Compression, Flag::Warning];
-        assert_eq!(Flag::get_collection(1 | 8), some);
-        let one = vec![Flag::Compression];
-        assert_eq!(Flag::get_collection(1), one);
-    }
-
-    #[test]
-    fn test_opcode_as_byte() {
-        assert_eq!(Opcode::Error.as_byte(), 0x00);
-        assert_eq!(Opcode::Startup.as_byte(), 0x01);
-        assert_eq!(Opcode::Ready.as_byte(), 0x02);
-        assert_eq!(Opcode::Authenticate.as_byte(), 0x03);
-        assert_eq!(Opcode::Options.as_byte(), 0x05);
-        assert_eq!(Opcode::Supported.as_byte(), 0x06);
-        assert_eq!(Opcode::Query.as_byte(), 0x07);
-        assert_eq!(Opcode::Result.as_byte(), 0x08);
-        assert_eq!(Opcode::Prepare.as_byte(), 0x09);
-        assert_eq!(Opcode::Execute.as_byte(), 0x0A);
-        assert_eq!(Opcode::Register.as_byte(), 0x0B);
-        assert_eq!(Opcode::Event.as_byte(), 0x0C);
-        assert_eq!(Opcode::Batch.as_byte(), 0x0D);
-        assert_eq!(Opcode::AuthChallenge.as_byte(), 0x0E);
-        assert_eq!(Opcode::AuthResponse.as_byte(), 0x0F);
-        assert_eq!(Opcode::AuthSuccess.as_byte(), 0x10);
-    }
-
-    #[test]
-    fn test_opcode_from() {
-        assert_eq!(Opcode::from(0x00), Opcode::Error);
-        assert_eq!(Opcode::from(0x01), Opcode::Startup);
-        assert_eq!(Opcode::from(0x02), Opcode::Ready);
-        assert_eq!(Opcode::from(0x03), Opcode::Authenticate);
-        assert_eq!(Opcode::from(0x05), Opcode::Options);
-        assert_eq!(Opcode::from(0x06), Opcode::Supported);
-        assert_eq!(Opcode::from(0x07), Opcode::Query);
-        assert_eq!(Opcode::from(0x08), Opcode::Result);
-        assert_eq!(Opcode::from(0x09), Opcode::Prepare);
-        assert_eq!(Opcode::from(0x0A), Opcode::Execute);
-        assert_eq!(Opcode::from(0x0B), Opcode::Register);
-        assert_eq!(Opcode::from(0x0C), Opcode::Event);
-        assert_eq!(Opcode::from(0x0D), Opcode::Batch);
-        assert_eq!(Opcode::from(0x0E), Opcode::AuthChallenge);
-        assert_eq!(Opcode::from(0x0F), Opcode::AuthResponse);
-        assert_eq!(Opcode::from(0x10), Opcode::AuthSuccess);
-    }
+  use super::*;
+  use crate::frame::traits::AsByte;
+
+  #[test]
+  #[cfg(not(feature = "v3"))]
+  fn test_frame_version_as_byte() {
+    let request_version = Version::Request;
+    assert_eq!(request_version.as_byte(), 0x04);
+    let response_version = Version::Response;
+    assert_eq!(response_version.as_byte(), 0x84);
+  }
+
+  #[test]
+  #[cfg(feature = "v3")]
+  fn test_frame_version_as_byte_v3() {
+    let request_version = Version::Request;
+    assert_eq!(request_version.as_byte(), 0x03);
+    let response_version = Version::Response;
+    assert_eq!(response_version.as_byte(), 0x83);
+  }
+
+  #[test]
+  #[cfg(not(feature = "v3"))]
+  fn test_frame_version_from() {
+    let request: Vec<u8> = vec![0x04];
+    assert_eq!(Version::from(request), Version::Request);
+    let response: Vec<u8> = vec![0x84];
+    assert_eq!(Version::from(response), Version::Response);
+  }
+
+  #[test]
+  #[cfg(feature = "v3")]
+  fn test_frame_version_from_v3() {
+    let request: Vec<u8> = vec![0x03];
+    assert_eq!(Version::from(request), Version::Request);
+    let response: Vec<u8> = vec![0x83];
+    assert_eq!(Version::from(response), Version::Response);
+  }
+
+  #[test]
+  fn test_flag_from() {
+    assert_eq!(Flag::from(0x01 as u8), Flag::Compression);
+    assert_eq!(Flag::from(0x02 as u8), Flag::Tracing);
+    assert_eq!(Flag::from(0x04 as u8), Flag::CustomPayload);
+    assert_eq!(Flag::from(0x08 as u8), Flag::Warning);
+    // rest should be interpreted as Ignore
+    assert_eq!(Flag::from(0x10 as u8), Flag::Ignore);
+    assert_eq!(Flag::from(0x31 as u8), Flag::Ignore);
+  }
+
+  #[test]
+  fn test_flag_as_byte() {
+    assert_eq!(Flag::Compression.as_byte(), 0x01);
+    assert_eq!(Flag::Tracing.as_byte(), 0x02);
+    assert_eq!(Flag::CustomPayload.as_byte(), 0x04);
+    assert_eq!(Flag::Warning.as_byte(), 0x08);
+  }
+
+  #[test]
+  fn test_flag_has_x() {
+    assert!(Flag::has_compression(0x01));
+    assert!(!Flag::has_compression(0x02));
+
+    assert!(Flag::has_tracing(0x02));
+    assert!(!Flag::has_tracing(0x01));
+
+    assert!(Flag::has_custom_payload(0x04));
+    assert!(!Flag::has_custom_payload(0x02));
+
+    assert!(Flag::has_warning(0x08));
+    assert!(!Flag::has_warning(0x01));
+  }
+
+  #[test]
+  fn test_flag_many_to_cbytes() {
+    let all = vec![
+      Flag::Compression,
+      Flag::Tracing,
+      Flag::CustomPayload,
+      Flag::Warning,
+    ];
+    assert_eq!(Flag::many_to_cbytes(&all), 1 | 2 | 4 | 8);
+    let some = vec![Flag::Compression, Flag::Warning];
+    assert_eq!(Flag::many_to_cbytes(&some), 1 | 8);
+    let one = vec![Flag::Compression];
+    assert_eq!(Flag::many_to_cbytes(&one), 1);
+  }
+
+  #[test]
+  fn test_flag_get_collection() {
+    let all = vec![
+      Flag::Compression,
+      Flag::Tracing,
+      Flag::CustomPayload,
+      Flag::Warning,
+    ];
+    assert_eq!(Flag::get_collection(1 | 2 | 4 | 8), all);
+    let some = vec![Flag::Compression, Flag::Warning];
+    assert_eq!(Flag::get_collection(1 | 8), some);
+    let one = vec![Flag::Compression];
+    assert_eq!(Flag::get_collection(1), one);
+  }
+
+  #[test]
+  fn test_opcode_as_byte() {
+    assert_eq!(Opcode::Error.as_byte(), 0x00);
+    assert_eq!(Opcode::Startup.as_byte(), 0x01);
+    assert_eq!(Opcode::Ready.as_byte(), 0x02);
+    assert_eq!(Opcode::Authenticate.as_byte(), 0x03);
+    assert_eq!(Opcode::Options.as_byte(), 0x05);
+    assert_eq!(Opcode::Supported.as_byte(), 0x06);
+    assert_eq!(Opcode::Query.as_byte(), 0x07);
+    assert_eq!(Opcode::Result.as_byte(), 0x08);
+    assert_eq!(Opcode::Prepare.as_byte(), 0x09);
+    assert_eq!(Opcode::Execute.as_byte(), 0x0A);
+    assert_eq!(Opcode::Register.as_byte(), 0x0B);
+    assert_eq!(Opcode::Event.as_byte(), 0x0C);
+    assert_eq!(Opcode::Batch.as_byte(), 0x0D);
+    assert_eq!(Opcode::AuthChallenge.as_byte(), 0x0E);
+    assert_eq!(Opcode::AuthResponse.as_byte(), 0x0F);
+    assert_eq!(Opcode::AuthSuccess.as_byte(), 0x10);
+  }
+
+  #[test]
+  fn test_opcode_from() {
+    assert_eq!(Opcode::from(0x00), Opcode::Error);
+    assert_eq!(Opcode::from(0x01), Opcode::Startup);
+    assert_eq!(Opcode::from(0x02), Opcode::Ready);
+    assert_eq!(Opcode::from(0x03), Opcode::Authenticate);
+    assert_eq!(Opcode::from(0x05), Opcode::Options);
+    assert_eq!(Opcode::from(0x06), Opcode::Supported);
+    assert_eq!(Opcode::from(0x07), Opcode::Query);
+    assert_eq!(Opcode::from(0x08), Opcode::Result);
+    assert_eq!(Opcode::from(0x09), Opcode::Prepare);
+    assert_eq!(Opcode::from(0x0A), Opcode::Execute);
+    assert_eq!(Opcode::from(0x0B), Opcode::Register);
+    assert_eq!(Opcode::from(0x0C), Opcode::Event);
+    assert_eq!(Opcode::from(0x0D), Opcode::Batch);
+    assert_eq!(Opcode::from(0x0E), Opcode::AuthChallenge);
+    assert_eq!(Opcode::from(0x0F), Opcode::AuthResponse);
+    assert_eq!(Opcode::from(0x10), Opcode::AuthSuccess);
+  }
 }
diff --git a/src/frame/parser.rs b/src/frame/parser.rs
index 7e496a3..9fd3e77 100644
--- a/src/frame/parser.rs
+++ b/src/frame/parser.rs
@@ -4,103 +4,103 @@ use std::io::{Cursor, Read};
 use std::ops::Deref;
 
 use super::*;
-use compression::Compression;
-use error;
-use frame::frame_response::ResponseBody;
-use frame::FromCursor;
-use transport::CDRSTransport;
-use types::data_serialization_types::decode_timeuuid;
-use types::{from_bytes, from_u16_bytes, CStringList, UUID_LEN};
+use crate::compression::Compression;
+use crate::error;
+use crate::frame::frame_response::ResponseBody;
+use crate::frame::FromCursor;
+use crate::transport::CDRSTransport;
+use crate::types::data_serialization_types::decode_timeuuid;
+use crate::types::{from_bytes, from_u16_bytes, CStringList, UUID_LEN};
 
 pub fn from_connection<M, T>(
-    conn: &r2d2::PooledConnection<M>,
-    compressor: &Compression,
+  conn: &r2d2::PooledConnection<M>,
+  compressor: &Compression,
 ) -> error::Result<Frame>
 where
-    T: CDRSTransport + 'static,
-    M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
+  T: CDRSTransport + 'static,
+  M: r2d2::ManageConnection<Connection = RefCell<T>, Error = error::Error> + Sized,
 {
-    parse_frame(conn.deref(), compressor)
+  parse_frame(conn.deref(), compressor)
 }
 
 pub fn parse_frame(cursor_cell: &RefCell<Read>, compressor: &Compression) -> error::Result<Frame> {
-    let mut version_bytes = [0; Version::BYTE_LENGTH];
-    let mut flag_bytes = [0; Flag::BYTE_LENGTH];
-    let mut opcode_bytes = [0; Opcode::BYTE_LENGTH];
-    let mut stream_bytes = [0; STREAM_LEN];
-    let mut length_bytes = [0; LENGTH_LEN];
-    let mut cursor = cursor_cell.borrow_mut();
-
-    // NOTE: order of reads matters
-    try!(cursor.read_exact(&mut version_bytes));
-    try!(cursor.read_exact(&mut flag_bytes));
-    try!(cursor.read_exact(&mut stream_bytes));
-    try!(cursor.read_exact(&mut opcode_bytes));
-    try!(cursor.read_exact(&mut length_bytes));
-
-    let version = Version::from(version_bytes.to_vec());
-    let flags = Flag::get_collection(flag_bytes[0]);
-    let stream = from_u16_bytes(&stream_bytes);
-    let opcode = Opcode::from(opcode_bytes[0]);
-    let length = from_bytes(&length_bytes) as usize;
-
-    let mut body_bytes = Vec::with_capacity(length);
+  let mut version_bytes = [0; Version::BYTE_LENGTH];
+  let mut flag_bytes = [0; Flag::BYTE_LENGTH];
+  let mut opcode_bytes = [0; Opcode::BYTE_LENGTH];
+  let mut stream_bytes = [0; STREAM_LEN];
+  let mut length_bytes = [0; LENGTH_LEN];
+  let mut cursor = cursor_cell.borrow_mut();
+
+  // NOTE: order of reads matters
+  cursor.read_exact(&mut version_bytes)?;
+  cursor.read_exact(&mut flag_bytes)?;
+  cursor.read_exact(&mut stream_bytes)?;
+  cursor.read_exact(&mut opcode_bytes)?;
+  cursor.read_exact(&mut length_bytes)?;
+
+  let version = Version::from(version_bytes.to_vec());
+  let flags = Flag::get_collection(flag_bytes[0]);
+  let stream = from_u16_bytes(&stream_bytes);
+  let opcode = Opcode::from(opcode_bytes[0]);
+  let length = from_bytes(&length_bytes) as usize;
+
+  let mut body_bytes = Vec::with_capacity(length);
+  unsafe {
+    body_bytes.set_len(length);
+  }
+
+  cursor.read_exact(&mut body_bytes)?;
+
+  let full_body = if flags.iter().any(|flag| flag == &Flag::Compression) {
+    compressor.decode(body_bytes)?
+  } else {
+    Compression::None.decode(body_bytes)?
+  };
+
+  // Use cursor to get tracing id, warnings and actual body
+  let mut body_cursor = Cursor::new(full_body.as_slice());
+
+  let tracing_id = if flags.iter().any(|flag| flag == &Flag::Tracing) {
+    let mut tracing_bytes = Vec::with_capacity(UUID_LEN);
     unsafe {
-        body_bytes.set_len(length);
+      tracing_bytes.set_len(UUID_LEN);
     }
-
-    try!(cursor.read_exact(&mut body_bytes));
-
-    let full_body = if flags.iter().any(|flag| flag == &Flag::Compression) {
-        try!(compressor.decode(body_bytes))
-    } else {
-        try!(Compression::None.decode(body_bytes))
-    };
-
-    // Use cursor to get tracing id, warnings and actual body
-    let mut body_cursor = Cursor::new(full_body.as_slice());
-
-    let tracing_id = if flags.iter().any(|flag| flag == &Flag::Tracing) {
-        let mut tracing_bytes = Vec::with_capacity(UUID_LEN);
-        unsafe {
-            tracing_bytes.set_len(UUID_LEN);
-        }
-        try!(body_cursor.read_exact(&mut tracing_bytes));
-
-        decode_timeuuid(tracing_bytes.as_slice()).ok()
-    } else {
-        None
-    };
-
-    let warnings = if flags.iter().any(|flag| flag == &Flag::Warning) {
-        CStringList::from_cursor(&mut body_cursor)?.into_plain()
-    } else {
-        vec![]
-    };
-
-    let mut body = vec![];
-
-    try!(body_cursor.read_to_end(&mut body));
-
-    let frame = Frame {
-        version: version,
-        flags: flags,
-        opcode: opcode,
-        stream: stream,
-        body: body,
-        tracing_id: tracing_id,
-        warnings: warnings,
-    };
-
-    convert_frame_into_result(frame)
+    body_cursor.read_exact(&mut tracing_bytes)?;
+
+    decode_timeuuid(tracing_bytes.as_slice()).ok()
+  } else {
+    None
+  };
+
+  let warnings = if flags.iter().any(|flag| flag == &Flag::Warning) {
+    CStringList::from_cursor(&mut body_cursor)?.into_plain()
+  } else {
+    vec![]
+  };
+
+  let mut body = vec![];
+
+  body_cursor.read_to_end(&mut body)?;
+
+  let frame = Frame {
+    version: version,
+    flags: flags,
+    opcode: opcode,
+    stream: stream,
+    body: body,
+    tracing_id: tracing_id,
+    warnings: warnings,
+  };
+
+  convert_frame_into_result(frame)
 }
 
 fn convert_frame_into_result(frame: Frame) -> error::Result<Frame> {
-    match frame.opcode {
-        Opcode::Error => frame.get_body().and_then(|err| match err {
-            ResponseBody::Error(err) => Err(error::Error::Server(err)),
-            _ => unreachable!(),
-        }),
-        _ => Ok(frame),
-    }
+  match frame.opcode {
+    Opcode::Error => frame.get_body().and_then(|err| match err {
+      ResponseBody::Error(err) => Err(error::Error::Server(err)),
+      _ => unreachable!(),
+    }),
+    _ => Ok(frame),
+  }
 }
diff --git a/src/frame/traits.rs b/src/frame/traits.rs
index 835e96a..066e736 100644
--- a/src/frame/traits.rs
+++ b/src/frame/traits.rs
@@ -1,9 +1,9 @@
 use std::io::Cursor;
 
-use error;
-use types::rows::Row;
-use types::udt::UDT;
-use query;
+use crate::error;
+use crate::query;
+use crate::types::rows::Row;
+use crate::types::udt::UDT;
 
 /// `IntoBytes` should be used to convert a structure into array of bytes.
 pub trait IntoBytes {
@@ -14,7 +14,7 @@ pub trait IntoBytes {
 /// `FromBytes` should be used to parse an array of bytes into a structure.
 pub trait FromBytes {
   /// It gets and array of bytes and should return an implementor struct.
-  fn from_bytes(&[u8]) -> error::Result<Self>
+  fn from_bytes(bytes: &[u8]) -> error::Result<Self>
   where
     Self: Sized;
 }
@@ -29,14 +29,14 @@ pub trait AsByte {
 /// It is opposite to `AsByte`.
 pub trait FromSingleByte {
   /// It should convert a single byte into an implementor struct.
-  fn from_byte(u8) -> Self;
+  fn from_byte(byte: u8) -> Self;
 }
 
 /// `FromCursor` should be used to get parsed structure from an `io:Cursor`
 /// wich bound to an array of bytes.
 pub trait FromCursor {
   /// It should return an implementor from an `io::Cursor` over an array of bytes.
-  fn from_cursor(&mut Cursor<&[u8]>) -> error::Result<Self>
+  fn from_cursor(cursor: &mut Cursor<&[u8]>) -> error::Result<Self>
   where
     Self: Sized;
 }
diff --git a/src/load_balancing/mod.rs b/src/load_balancing/mod.rs
index db07afb..6906d6b 100644
--- a/src/load_balancing/mod.rs
+++ b/src/load_balancing/mod.rs
@@ -3,10 +3,10 @@ mod round_robin;
 mod round_robin_sync;
 mod single_node;
 
-pub use load_balancing::random::Random;
-pub use load_balancing::round_robin::RoundRobin;
-pub use load_balancing::round_robin_sync::RoundRobinSync;
-pub use load_balancing::single_node::SingleNode;
+pub use crate::load_balancing::random::Random;
+pub use crate::load_balancing::round_robin::RoundRobin;
+pub use crate::load_balancing::round_robin_sync::RoundRobinSync;
+pub use crate::load_balancing::single_node::SingleNode;
 
 pub trait LoadBalancingStrategy<N>: Sized {
   fn init(&mut self, cluster: Vec<N>);
diff --git a/src/query/batch_executor.rs b/src/query/batch_executor.rs
index 722cff2..0287552 100644
--- a/src/query/batch_executor.rs
+++ b/src/query/batch_executor.rs
@@ -1,12 +1,12 @@
 use r2d2;
 use std::cell::RefCell;
 
-use cluster::{GetCompressor, GetConnection};
-use error;
-use frame::traits::IntoBytes;
-use frame::Frame;
-use query::batch_query_builder::QueryBatch;
-use transport::CDRSTransport;
+use crate::cluster::{GetCompressor, GetConnection};
+use crate::error;
+use crate::frame::traits::IntoBytes;
+use crate::frame::Frame;
+use crate::query::batch_query_builder::QueryBatch;
+use crate::transport::CDRSTransport;
 
 use super::utils::{prepare_flags, send_frame};
 
diff --git a/src/query/batch_query_builder.rs b/src/query/batch_query_builder.rs
index fed78af..a9cf6b6 100644
--- a/src/query/batch_query_builder.rs
+++ b/src/query/batch_query_builder.rs
@@ -1,8 +1,8 @@
-use error::{Error as CError, Result as CResult};
-use consistency::Consistency;
-use frame::frame_batch::{BatchQuery, BatchQuerySubj, BatchType, BodyReqBatch};
-use query::{QueryFlags, QueryValues};
-use types::{CBytesShort, CStringLong};
+use crate::consistency::Consistency;
+use crate::error::{Error as CError, Result as CResult};
+use crate::frame::frame_batch::{BatchQuery, BatchQuerySubj, BatchType, BodyReqBatch};
+use crate::query::{QueryFlags, QueryValues};
+use crate::types::{CBytesShort, CStringLong};
 
 pub type QueryBatch = BodyReqBatch;
 
@@ -17,11 +17,13 @@ pub struct BatchQueryBuilder {
 
 impl BatchQueryBuilder {
   pub fn new() -> BatchQueryBuilder {
-    BatchQueryBuilder { batch_type: BatchType::Logged,
-                        queries: vec![],
-                        consistency: Consistency::One,
-                        serial_consistency: None,
-                        timestamp: None, }
+    BatchQueryBuilder {
+      batch_type: BatchType::Logged,
+      queries: vec![],
+      consistency: Consistency::One,
+      serial_consistency: None,
+      timestamp: None,
+    }
   }
 
   pub fn batch_type(mut self, batch_type: BatchType) -> Self {
@@ -31,18 +33,21 @@ impl BatchQueryBuilder {
 
   /// Add a query (non-prepared one)
   pub fn add_query<T: Into<String>>(mut self, query: T, values: QueryValues) -> Self {
-    self.queries
-        .push(BatchQuery { is_prepared: false,
-                           subject: BatchQuerySubj::QueryString(CStringLong::new(query.into())),
-                           values, });
+    self.queries.push(BatchQuery {
+      is_prepared: false,
+      subject: BatchQuerySubj::QueryString(CStringLong::new(query.into())),
+      values,
+    });
     self
   }
 
   /// Add a query (prepared one)
   pub fn add_query_prepared(mut self, query_id: CBytesShort, values: QueryValues) -> Self {
-    self.queries.push(BatchQuery { is_prepared: true,
-                                   subject: BatchQuerySubj::PreparedId(query_id),
-                                   values, });
+    self.queries.push(BatchQuery {
+      is_prepared: true,
+      subject: BatchQuerySubj::PreparedId(query_id),
+      values,
+    });
     self
   }
 
@@ -83,8 +88,10 @@ impl BatchQueryBuilder {
       let some_names_for_values = self.queries.iter().any(|q| q.values.with_names());
 
       if some_names_for_values {
-        return Err(CError::General(String::from("Inconsistent query values - mixed \
-                                                 with and without names values")));
+        return Err(CError::General(String::from(
+          "Inconsistent query values - mixed \
+           with and without names values",
+        )));
       }
     }
 
@@ -92,11 +99,13 @@ impl BatchQueryBuilder {
       flags.push(QueryFlags::WithNamesForValues);
     }
 
-    Ok(BodyReqBatch { batch_type: self.batch_type,
-                      queries: self.queries,
-                      query_flags: flags,
-                      consistency: self.consistency,
-                      serial_consistency: self.serial_consistency,
-                      timestamp: self.timestamp, })
+    Ok(BodyReqBatch {
+      batch_type: self.batch_type,
+      queries: self.queries,
+      query_flags: flags,
+      consistency: self.consistency,
+      serial_consistency: self.serial_consistency,
+      timestamp: self.timestamp,
+    })
   }
 }
diff --git a/src/query/exec_executor.rs b/src/query/exec_executor.rs
index 5710b11..4601f89 100644
--- a/src/query/exec_executor.rs
+++ b/src/query/exec_executor.rs
@@ -1,12 +1,12 @@
 use r2d2;
 use std::cell::RefCell;
 
-use cluster::{GetCompressor, GetConnection};
-use error;
-use frame::{Frame, IntoBytes};
-use query::{QueryParams, QueryParamsBuilder, QueryValues};
-use transport::CDRSTransport;
-use types::CBytesShort;
+use crate::cluster::{GetCompressor, GetConnection};
+use crate::error;
+use crate::frame::{Frame, IntoBytes};
+use crate::query::{QueryParams, QueryParamsBuilder, QueryValues};
+use crate::transport::CDRSTransport;
+use crate::types::CBytesShort;
 
 use super::utils::{prepare_flags, send_frame};
 
diff --git a/src/query/mod.rs b/src/query/mod.rs
index c275fab..18684ff 100644
--- a/src/query/mod.rs
+++ b/src/query/mod.rs
@@ -10,13 +10,13 @@ mod query_params_builder;
 mod query_values;
 mod utils;
 
-pub use query::batch_executor::BatchExecutor;
-pub use query::batch_query_builder::{BatchQueryBuilder, QueryBatch};
-pub use query::exec_executor::ExecExecutor;
-pub use query::prepare_executor::{PrepareExecutor, PreparedQuery};
-pub use query::query::Query;
-pub use query::query_executor::QueryExecutor;
-pub use query::query_flags::QueryFlags;
-pub use query::query_params::QueryParams;
-pub use query::query_params_builder::QueryParamsBuilder;
-pub use query::query_values::QueryValues;
+pub use crate::query::batch_executor::BatchExecutor;
+pub use crate::query::batch_query_builder::{BatchQueryBuilder, QueryBatch};
+pub use crate::query::exec_executor::ExecExecutor;
+pub use crate::query::prepare_executor::{PrepareExecutor, PreparedQuery};
+pub use crate::query::query::Query;
+pub use crate::query::query_executor::QueryExecutor;
+pub use crate::query::query_flags::QueryFlags;
+pub use crate::query::query_params::QueryParams;
+pub use crate::query::query_params_builder::QueryParamsBuilder;
+pub use crate::query::query_values::QueryValues;
diff --git a/src/query/prepare_executor.rs b/src/query/prepare_executor.rs
index 0d64385..a16c4c8 100644
--- a/src/query/prepare_executor.rs
+++ b/src/query/prepare_executor.rs
@@ -1,11 +1,11 @@
 use r2d2;
 use std::cell::RefCell;
 
-use cluster::{GetCompressor, GetConnection};
-use error;
-use frame::{Frame, IntoBytes};
-use transport::CDRSTransport;
-use types::CBytesShort;
+use crate::cluster::{GetCompressor, GetConnection};
+use crate::error;
+use crate::frame::{Frame, IntoBytes};
+use crate::transport::CDRSTransport;
+use crate::types::CBytesShort;
 
 use super::utils::{prepare_flags, send_frame};
 
diff --git a/src/query/query_executor.rs b/src/query/query_executor.rs
index 2473814..8c72426 100644
--- a/src/query/query_executor.rs
+++ b/src/query/query_executor.rs
@@ -1,11 +1,11 @@
 use r2d2;
 use std::cell::RefCell;
 
-use cluster::{GetCompressor, GetConnection};
-use error;
-use frame::{Frame, IntoBytes};
-use query::{Query, QueryParams, QueryParamsBuilder, QueryValues};
-use transport::CDRSTransport;
+use crate::cluster::{GetCompressor, GetConnection};
+use crate::error;
+use crate::frame::{Frame, IntoBytes};
+use crate::query::{Query, QueryParams, QueryParamsBuilder, QueryValues};
+use crate::transport::CDRSTransport;
 
 use super::utils::{prepare_flags, send_frame};
 
diff --git a/src/query/query_flags.rs b/src/query/query_flags.rs
index 943c732..8e73541 100644
--- a/src/query/query_flags.rs
+++ b/src/query/query_flags.rs
@@ -1,4 +1,4 @@
-use frame::AsByte;
+use crate::frame::AsByte;
 
 const FLAGS_VALUE: u8 = 0x01;
 const FLAGS_SKIP_METADATA: u8 = 0x02;
@@ -119,137 +119,193 @@ mod tests {
 
   #[test]
   fn has_value_test() {
-    assert!(QueryFlags::has_value(FLAGS_VALUE | 0x10),
-            "should show that the flag has value");
-    assert!(!QueryFlags::has_value(FLAGS_SKIP_METADATA),
-            "should show that the flag does NOT have value");
+    assert!(
+      QueryFlags::has_value(FLAGS_VALUE | 0x10),
+      "should show that the flag has value"
+    );
+    assert!(
+      !QueryFlags::has_value(FLAGS_SKIP_METADATA),
+      "should show that the flag does NOT have value"
+    );
   }
 
   #[test]
   fn set_value_test() {
-    assert_eq!(QueryFlags::set_value(0),
-               FLAGS_VALUE,
-               "should set has value flag");
+    assert_eq!(
+      QueryFlags::set_value(0),
+      FLAGS_VALUE,
+      "should set has value flag"
+    );
   }
 
   #[test]
   fn has_skip_metadata_test() {
-    assert!(QueryFlags::has_skip_metadata(FLAGS_SKIP_METADATA | 0x10),
-            "should show that the flag has skip metadata");
-    assert!(!QueryFlags::has_skip_metadata(FLAGS_VALUE),
-            "should show that the flag does NOT have skip metadata");
+    assert!(
+      QueryFlags::has_skip_metadata(FLAGS_SKIP_METADATA | 0x10),
+      "should show that the flag has skip metadata"
+    );
+    assert!(
+      !QueryFlags::has_skip_metadata(FLAGS_VALUE),
+      "should show that the flag does NOT have skip metadata"
+    );
   }
 
   #[test]
   fn set_skip_metadata_test() {
-    assert_eq!(QueryFlags::set_skip_metadata(0),
-               FLAGS_SKIP_METADATA,
-               "should set has skip metadata flag");
+    assert_eq!(
+      QueryFlags::set_skip_metadata(0),
+      FLAGS_SKIP_METADATA,
+      "should set has skip metadata flag"
+    );
   }
 
   #[test]
   fn has_page_size_test() {
-    assert!(QueryFlags::has_page_size(WITH_PAGE_SIZE | 0x10),
-            "should show that the flag has with page size");
-    assert!(!QueryFlags::has_page_size(FLAGS_VALUE),
-            "should show that the flag does NOT have with page size");
+    assert!(
+      QueryFlags::has_page_size(WITH_PAGE_SIZE | 0x10),
+      "should show that the flag has with page size"
+    );
+    assert!(
+      !QueryFlags::has_page_size(FLAGS_VALUE),
+      "should show that the flag does NOT have with page size"
+    );
   }
 
   #[test]
   fn set_page_size_test() {
-    assert_eq!(QueryFlags::set_page_size(0),
-               WITH_PAGE_SIZE,
-               "should set has page size flag");
+    assert_eq!(
+      QueryFlags::set_page_size(0),
+      WITH_PAGE_SIZE,
+      "should set has page size flag"
+    );
   }
 
   #[test]
   fn has_with_paging_state_test() {
-    assert!(QueryFlags::has_with_paging_state(WITH_PAGING_STATE | 0x10),
-            "should show that the flag has with paging state");
-    assert!(!QueryFlags::has_with_paging_state(FLAGS_VALUE),
-            "should show that the flag does NOT have with paging state");
+    assert!(
+      QueryFlags::has_with_paging_state(WITH_PAGING_STATE | 0x10),
+      "should show that the flag has with paging state"
+    );
+    assert!(
+      !QueryFlags::has_with_paging_state(FLAGS_VALUE),
+      "should show that the flag does NOT have with paging state"
+    );
   }
 
   #[test]
   fn set_with_paging_state_test() {
-    assert_eq!(QueryFlags::set_with_paging_state(0),
-               WITH_PAGING_STATE,
-               "should set has with paging state flag");
+    assert_eq!(
+      QueryFlags::set_with_paging_state(0),
+      WITH_PAGING_STATE,
+      "should set has with paging state flag"
+    );
   }
 
   #[test]
   fn has_with_serial_consistency_test() {
-    assert!(QueryFlags::has_with_serial_consistency(WITH_SERIAL_CONSISTENCY | 0x11),
-            "should show that the flag has with serial consistency");
-    assert!(!QueryFlags::has_with_serial_consistency(FLAGS_VALUE),
-            "should show that the flag does NOT have with serial consistency");
+    assert!(
+      QueryFlags::has_with_serial_consistency(WITH_SERIAL_CONSISTENCY | 0x11),
+      "should show that the flag has with serial consistency"
+    );
+    assert!(
+      !QueryFlags::has_with_serial_consistency(FLAGS_VALUE),
+      "should show that the flag does NOT have with serial consistency"
+    );
   }
 
   #[test]
   fn set_with_serial_consistency_test() {
-    assert_eq!(QueryFlags::set_with_serial_consistency(0),
-               WITH_SERIAL_CONSISTENCY,
-               "should set has with serial consistency flag");
+    assert_eq!(
+      QueryFlags::set_with_serial_consistency(0),
+      WITH_SERIAL_CONSISTENCY,
+      "should set has with serial consistency flag"
+    );
   }
 
   #[test]
   fn has_with_default_timestamp_test() {
-    assert!(QueryFlags::has_with_default_timestamp(WITH_DEFAULT_TIMESTAMP | 0x10),
-            "should show that the flag has with default timestamp");
-    assert!(!QueryFlags::has_with_default_timestamp(FLAGS_VALUE),
-            "should show that the flag does NOT have with default timestamp");
+    assert!(
+      QueryFlags::has_with_default_timestamp(WITH_DEFAULT_TIMESTAMP | 0x10),
+      "should show that the flag has with default timestamp"
+    );
+    assert!(
+      !QueryFlags::has_with_default_timestamp(FLAGS_VALUE),
+      "should show that the flag does NOT have with default timestamp"
+    );
   }
 
   #[test]
   fn set_with_default_timestamp_test() {
-    assert_eq!(QueryFlags::set_with_default_timestamp(0),
-               WITH_DEFAULT_TIMESTAMP,
-               "should set has with serial consistency flag");
+    assert_eq!(
+      QueryFlags::set_with_default_timestamp(0),
+      WITH_DEFAULT_TIMESTAMP,
+      "should set has with serial consistency flag"
+    );
   }
 
   #[test]
   fn has_with_names_for_values_test() {
-    assert!(QueryFlags::has_with_names_for_values(WITH_NAME_FOR_VALUES | 0x10),
-            "should show that the flag has with name for values");
-    assert!(!QueryFlags::has_with_names_for_values(FLAGS_VALUE),
-            "should show that the flag does NOT have with name for values");
+    assert!(
+      QueryFlags::has_with_names_for_values(WITH_NAME_FOR_VALUES | 0x10),
+      "should show that the flag has with name for values"
+    );
+    assert!(
+      !QueryFlags::has_with_names_for_values(FLAGS_VALUE),
+      "should show that the flag does NOT have with name for values"
+    );
   }
 
   #[test]
   fn set_with_names_for_values_test() {
-    assert_eq!(QueryFlags::set_with_names_for_values(0),
-               WITH_NAME_FOR_VALUES,
-               "should set has with name for values flag");
+    assert_eq!(
+      QueryFlags::set_with_names_for_values(0),
+      WITH_NAME_FOR_VALUES,
+      "should set has with name for values flag"
+    );
   }
 
   #[test]
   fn as_byte_test() {
-    assert_eq!(QueryFlags::Value.as_byte(),
-               FLAGS_VALUE,
-               "should propery convert values flag");
-
-    assert_eq!(QueryFlags::SkipMetadata.as_byte(),
-               FLAGS_SKIP_METADATA,
-               "should propery convert skip metadata flag");
-
-    assert_eq!(QueryFlags::PageSize.as_byte(),
-               WITH_PAGE_SIZE,
-               "should propery convert with page size flag");
-
-    assert_eq!(QueryFlags::WithPagingState.as_byte(),
-               WITH_PAGING_STATE,
-               "should propery convert with paging state flag");
-
-    assert_eq!(QueryFlags::WithSerialConsistency.as_byte(),
-               WITH_SERIAL_CONSISTENCY,
-               "should propery convert with serial consistency flag");
-
-    assert_eq!(QueryFlags::WithDefaultTimestamp.as_byte(),
-               WITH_DEFAULT_TIMESTAMP,
-               "should propery convert with default timestamp flag");
-
-    assert_eq!(QueryFlags::WithNamesForValues.as_byte(),
-               WITH_NAME_FOR_VALUES,
-               "should propery convert with name for values flag");
+    assert_eq!(
+      QueryFlags::Value.as_byte(),
+      FLAGS_VALUE,
+      "should propery convert values flag"
+    );
+
+    assert_eq!(
+      QueryFlags::SkipMetadata.as_byte(),
+      FLAGS_SKIP_METADATA,
+      "should propery convert skip metadata flag"
+    );
+
+    assert_eq!(
+      QueryFlags::PageSize.as_byte(),
+      WITH_PAGE_SIZE,
+      "should propery convert with page size flag"
+    );
+
+    assert_eq!(
+      QueryFlags::WithPagingState.as_byte(),
+      WITH_PAGING_STATE,
+      "should propery convert with paging state flag"
+    );
+
+    assert_eq!(
+      QueryFlags::WithSerialConsistency.as_byte(),
+      WITH_SERIAL_CONSISTENCY,
+      "should propery convert with serial consistency flag"
+    );
+
+    assert_eq!(
+      QueryFlags::WithDefaultTimestamp.as_byte(),
+      WITH_DEFAULT_TIMESTAMP,
+      "should propery convert with default timestamp flag"
+    );
+
+    assert_eq!(
+      QueryFlags::WithNamesForValues.as_byte(),
+      WITH_NAME_FOR_VALUES,
+      "should propery convert with name for values flag"
+    );
   }
 }
diff --git a/src/query/query_params.rs b/src/query/query_params.rs
index 19257ef..b495831 100644
--- a/src/query/query_params.rs
+++ b/src/query/query_params.rs
@@ -1,9 +1,9 @@
-use consistency::Consistency;
-use types::{to_bigint, to_int, to_short, CBytes};
-use frame::AsByte;
-use frame::IntoBytes;
-use query::query_flags::QueryFlags;
-use query::query_values::QueryValues;
+use crate::consistency::Consistency;
+use crate::frame::AsByte;
+use crate::frame::IntoBytes;
+use crate::query::query_flags::QueryFlags;
+use crate::query::query_values::QueryValues;
+use crate::types::{to_bigint, to_int, to_short, CBytes};
 
 /// Parameters of Query for query operation.
 #[derive(Debug, Default)]
@@ -81,33 +81,45 @@ impl IntoBytes for QueryParams {
     }
     if QueryFlags::has_page_size(self.flags_as_byte()) && self.page_size.is_some() {
       // XXX clone
-      v.extend_from_slice(to_int(self.page_size
-                                    .clone()
-                                    // unwrap is safe as we've checked that
-                                    // self.page_size.is_some()
-                                    .unwrap())
-                                    .as_slice());
+      v.extend_from_slice(
+        to_int(
+          self
+            .page_size
+            .clone()
+            // unwrap is safe as we've checked that
+            // self.page_size.is_some()
+            .unwrap(),
+        )
+        .as_slice(),
+      );
     }
     if QueryFlags::has_with_paging_state(self.flags_as_byte()) && self.paging_state.is_some() {
       // XXX clone
-      v.extend_from_slice(self.paging_state
-                                    .clone()
-                                    // unwrap is safe as we've checked that
-                                    // self.paging_state.is_some()
-                                    .unwrap()
-                                    .into_cbytes()
-                                    .as_slice());
+      v.extend_from_slice(
+        self
+          .paging_state
+          .clone()
+          // unwrap is safe as we've checked that
+          // self.paging_state.is_some()
+          .unwrap()
+          .into_cbytes()
+          .as_slice(),
+      );
     }
     if QueryFlags::has_with_serial_consistency(self.flags_as_byte())
-       && self.serial_consistency.is_some() {
+      && self.serial_consistency.is_some()
+    {
       // XXX clone
-      v.extend_from_slice(self.serial_consistency
-                                    .clone()
-                                    // unwrap is safe as we've checked that
-                                    // self.serial_consistency.is_some()
-                                    .unwrap()
-                                    .into_cbytes()
-                                    .as_slice());
+      v.extend_from_slice(
+        self
+          .serial_consistency
+          .clone()
+          // unwrap is safe as we've checked that
+          // self.serial_consistency.is_some()
+          .unwrap()
+          .into_cbytes()
+          .as_slice(),
+      );
     }
     if QueryFlags::has_with_default_timestamp(self.flags_as_byte()) && self.timestamp.is_some() {
       // unwrap is safe as we've checked that self.timestamp.is_some()
diff --git a/src/query/query_params_builder.rs b/src/query/query_params_builder.rs
index 47aa0c6..a0595d9 100644
--- a/src/query/query_params_builder.rs
+++ b/src/query/query_params_builder.rs
@@ -1,6 +1,6 @@
 use super::{QueryFlags, QueryParams, QueryValues};
-use consistency::Consistency;
-use types::CBytes;
+use crate::consistency::Consistency;
+use crate::types::CBytes;
 
 #[derive(Debug, Default)]
 pub struct QueryParamsBuilder {
diff --git a/src/query/query_values.rs b/src/query/query_values.rs
index 470fd1e..1a1f985 100644
--- a/src/query/query_values.rs
+++ b/src/query/query_values.rs
@@ -1,9 +1,9 @@
 use std::collections::HashMap;
 use std::hash::Hash;
 
-use frame::IntoBytes;
-use types::CString;
-use types::value::Value;
+use crate::frame::IntoBytes;
+use crate::types::value::Value;
+use crate::types::CString;
 
 /// Enum that represents two types of query values:
 /// * values without name
@@ -81,9 +81,9 @@ impl IntoBytes for QueryValues {
     let bytes: Vec<u8> = vec![];
     match *self {
       QueryValues::SimpleValues(ref v) => v.iter().fold(bytes, QueryValues::value_into_bytes_fold),
-      QueryValues::NamedValues(ref v) => {
-        v.iter().fold(bytes, QueryValues::named_value_into_bytes_fold)
-      }
+      QueryValues::NamedValues(ref v) => v
+        .iter()
+        .fold(bytes, QueryValues::named_value_into_bytes_fold),
     }
   }
 }
diff --git a/src/query/utils.rs b/src/query/utils.rs
index ac344d7..18a5fc6 100644
--- a/src/query/utils.rs
+++ b/src/query/utils.rs
@@ -1,10 +1,10 @@
 use std::cell::RefCell;
 
-use cluster::{GetCompressor, GetConnection};
-use error;
-use frame::parser::from_connection;
-use frame::{Flag, Frame};
-use transport::CDRSTransport;
+use crate::cluster::{GetCompressor, GetConnection};
+use crate::error;
+use crate::frame::parser::from_connection;
+use crate::frame::{Flag, Frame};
+use crate::transport::CDRSTransport;
 
 pub fn prepare_flags(with_tracing: bool, with_warnings: bool) -> Vec<Flag> {
   let mut flags = vec![];
diff --git a/src/types/data_serialization_types.rs b/src/types/data_serialization_types.rs
index 4543981..8b93756 100644
--- a/src/types/data_serialization_types.rs
+++ b/src/types/data_serialization_types.rs
@@ -5,54 +5,54 @@ use std::string::FromUtf8Error;
 use super::blob::Blob;
 use super::decimal::Decimal;
 use super::*;
-use error;
-use frame::FromCursor;
+use crate::error;
+use crate::frame::FromCursor;
 use uuid;
 
 // https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L813
 
 // Decodes Cassandra `ascii` data (bytes) into Rust's `Result<String, FromUtf8Error>`.
 pub fn decode_custom(bytes: &[u8]) -> Result<String, FromUtf8Error> {
-    Ok(String::from_utf8_lossy(bytes).into_owned())
+  Ok(String::from_utf8_lossy(bytes).into_owned())
 }
 
 // Decodes Cassandra `ascii` data (bytes) into Rust's `Result<String, FromUtf8Error>`.
 pub fn decode_ascii(bytes: &[u8]) -> Result<String, FromUtf8Error> {
-    Ok(String::from_utf8_lossy(bytes).into_owned())
+  Ok(String::from_utf8_lossy(bytes).into_owned())
 }
 
 // Decodes Cassandra `varchar` data (bytes) into Rust's `Result<String, FromUtf8Error>`.
 pub fn decode_varchar(bytes: &[u8]) -> Result<String, FromUtf8Error> {
-    Ok(String::from_utf8_lossy(bytes).into_owned())
+  Ok(String::from_utf8_lossy(bytes).into_owned())
 }
 
 // Decodes Cassandra `bigint` data (bytes) into Rust's `Result<i32, io::Error>`
 pub fn decode_bigint(bytes: &[u8]) -> Result<i64, io::Error> {
-    try_from_bytes(bytes).map(|i| i as i64)
+  try_from_bytes(bytes).map(|i| i as i64)
 }
 
 // Decodes Cassandra `blob` data (bytes) into Rust's `Result<Vec<u8>, io::Error>`
 pub fn decode_blob(bytes: &Vec<u8>) -> Result<Blob, io::Error> {
-    // in fact we just pass it through.
-    Ok(bytes.clone().into())
+  // in fact we just pass it through.
+  Ok(bytes.clone().into())
 }
 
 // Decodes Cassandra `boolean` data (bytes) into Rust's `Result<i32, io::Error>`
 pub fn decode_boolean(bytes: &[u8]) -> Result<bool, io::Error> {
-    let false_byte: u8 = 0;
-    if bytes.is_empty() {
-        Err(io::Error::new(
-            io::ErrorKind::UnexpectedEof,
-            "no bytes were found",
-        ))
-    } else {
-        Ok(bytes[0] != false_byte)
-    }
+  let false_byte: u8 = 0;
+  if bytes.is_empty() {
+    Err(io::Error::new(
+      io::ErrorKind::UnexpectedEof,
+      "no bytes were found",
+    ))
+  } else {
+    Ok(bytes[0] != false_byte)
+  }
 }
 
 // Decodes Cassandra `int` data (bytes) into Rust's `Result<i32, io::Error>`
 pub fn decode_int(bytes: &[u8]) -> Result<i32, io::Error> {
-    try_from_bytes(bytes).map(|i| i as i32)
+  try_from_bytes(bytes).map(|i| i as i32)
 }
 
 // Decodes Cassandra `date` data (bytes) into Rust's `Result<i32, io::Error>` in following way
@@ -60,56 +60,56 @@ pub fn decode_int(bytes: &[u8]) -> Result<i32, io::Error> {
 // 2^31: 1970-1-1
 // 2^32: 5881580-07-11
 pub fn decode_date(bytes: &[u8]) -> Result<i32, io::Error> {
-    try_from_bytes(bytes).map(|i| i as i32)
+  try_from_bytes(bytes).map(|i| i as i32)
 }
 
 // Decodes Cassandra `decimal` data (bytes) into Rust's `Result<f32, io::Error>`
 pub fn decode_decimal(bytes: &[u8]) -> Result<Decimal, io::Error> {
-    let lr = bytes.split_at(INT_LEN);
+  let lr = bytes.split_at(INT_LEN);
 
-    let scale = try_i_from_bytes(lr.0)? as u32;
-    let unscaled = try_i_from_bytes(lr.1)?;
+  let scale = try_i_from_bytes(lr.0)? as u32;
+  let unscaled = try_i_from_bytes(lr.1)?;
 
-    Ok(Decimal::new(unscaled, scale))
+  Ok(Decimal::new(unscaled, scale))
 }
 
 // Decodes Cassandra `double` data (bytes) into Rust's `Result<f32, io::Error>`
 pub fn decode_double(bytes: &[u8]) -> Result<f64, io::Error> {
-    try_f64_from_bytes(bytes)
+  try_f64_from_bytes(bytes)
 }
 
 // Decodes Cassandra `float` data (bytes) into Rust's `Result<f32, io::Error>`
 pub fn decode_float(bytes: &[u8]) -> Result<f32, io::Error> {
-    try_f32_from_bytes(bytes)
+  try_f32_from_bytes(bytes)
 }
 
 // Decodes Cassandra `inet` data (bytes) into Rust's `Result<net::IpAddr, io::Error>`
 pub fn decode_inet(bytes: &[u8]) -> Result<net::IpAddr, io::Error> {
-    match bytes.len() {
-        // v4
-        4 => Ok(net::IpAddr::V4(net::Ipv4Addr::new(
-            bytes[0], bytes[1], bytes[2], bytes[3],
-        ))),
-        // v6
-        16 => {
-            let a = from_u16_bytes(&bytes[0..2]);
-            let b = from_u16_bytes(&bytes[2..4]);
-            let c = from_u16_bytes(&bytes[4..6]);
-            let d = from_u16_bytes(&bytes[6..8]);
-            let e = from_u16_bytes(&bytes[8..10]);
-            let f = from_u16_bytes(&bytes[10..12]);
-            let g = from_u16_bytes(&bytes[12..14]);
-            let h = from_u16_bytes(&bytes[14..16]);
-            Ok(net::IpAddr::V6(net::Ipv6Addr::new(a, b, c, d, e, f, g, h)))
-        }
-        _ => {
-            // let message = format!("Unparseable  Ip address {:?}", bytes);
-            Err(io::Error::new(
-                io::ErrorKind::Other,
-                format!("Unparseable  Ip address {:?}", bytes),
-            ))
-        }
-    }
+  match bytes.len() {
+    // v4
+    4 => Ok(net::IpAddr::V4(net::Ipv4Addr::new(
+      bytes[0], bytes[1], bytes[2], bytes[3],
+    ))),
+    // v6
+    16 => {
+      let a = from_u16_bytes(&bytes[0..2]);
+      let b = from_u16_bytes(&bytes[2..4]);
+      let c = from_u16_bytes(&bytes[4..6]);
+      let d = from_u16_bytes(&bytes[6..8]);
+      let e = from_u16_bytes(&bytes[8..10]);
+      let f = from_u16_bytes(&bytes[10..12]);
+      let g = from_u16_bytes(&bytes[12..14]);
+      let h = from_u16_bytes(&bytes[14..16]);
+      Ok(net::IpAddr::V6(net::Ipv6Addr::new(a, b, c, d, e, f, g, h)))
+    }
+    _ => {
+      // let message = format!("Unparseable  Ip address {:?}", bytes);
+      Err(io::Error::new(
+        io::ErrorKind::Other,
+        format!("Unparseable  Ip address {:?}", bytes),
+      ))
+    }
+  }
 }
 
 // Decodes Cassandra `timestamp` data (bytes) into Rust's `Result<i64, io::Error>`
@@ -117,452 +117,453 @@ pub fn decode_inet(bytes: &[u8]) -> Result<net::IpAddr, io::Error> {
 //  offset from the unix epoch (00:00:00, January 1st, 1970).  Negative values
 //  represent a negative offset from the epoch.
 pub fn decode_timestamp(bytes: &[u8]) -> Result<i64, io::Error> {
-    try_from_bytes(bytes).map(|i| i as i64)
+  try_from_bytes(bytes).map(|i| i as i64)
 }
 
 // Decodes Cassandra `list` data (bytes) into Rust's `Result<Vec<CBytes>, io::Error>`
 pub fn decode_list(bytes: &[u8]) -> Result<Vec<CBytes>, io::Error> {
-    let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
-    let l = CInt::from_cursor(&mut cursor)
-        .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
-    let mut list = Vec::with_capacity(l as usize);
-    for _ in 0..l {
-        let b = CBytes::from_cursor(&mut cursor)
-            .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
-        list.push(b);
-    }
-    Ok(list)
+  let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
+  let l =
+    CInt::from_cursor(&mut cursor).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
+  let mut list = Vec::with_capacity(l as usize);
+  for _ in 0..l {
+    let b = CBytes::from_cursor(&mut cursor)
+      .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+    list.push(b);
+  }
+  Ok(list)
 }
 
 // Decodes Cassandra `set` data (bytes) into Rust's `Result<Vec<CBytes>, io::Error>`
 pub fn decode_set(bytes: &[u8]) -> Result<Vec<CBytes>, io::Error> {
-    decode_list(bytes)
+  decode_list(bytes)
 }
 
 // Decodes Cassandra `map` data (bytes) into Rust's `Result<Vec<(CBytes, CBytes)>, io::Error>`
 pub fn decode_map(bytes: &[u8]) -> Result<Vec<(CBytes, CBytes)>, io::Error> {
-    let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
-    let l = CInt::from_cursor(&mut cursor)
-        .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
-    let mut map = Vec::with_capacity(l as usize);
-    for _ in 0..l {
-        let n = CBytes::from_cursor(&mut cursor)
-            .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
-        let v = CBytes::from_cursor(&mut cursor)
-            .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
-        map.push((n, v));
-    }
-    Ok(map)
+  let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
+  let l = CInt::from_cursor(&mut cursor)
+    .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+  let mut map = Vec::with_capacity(l as usize);
+  for _ in 0..l {
+    let n = CBytes::from_cursor(&mut cursor)
+      .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+    let v = CBytes::from_cursor(&mut cursor)
+      .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+    map.push((n, v));
+  }
+  Ok(map)
 }
 
 // Decodes Cassandra `smallint` data (bytes) into Rust's `Result<i16, io::Error>`
 pub fn decode_smallint(bytes: &[u8]) -> Result<i16, io::Error> {
-    try_from_bytes(bytes).map(|i| i as i16)
+  try_from_bytes(bytes).map(|i| i as i16)
 }
 
 // Decodes Cassandra `tinyint` data (bytes) into Rust's `Result<i8, io::Error>`
 pub fn decode_tinyint(bytes: &[u8]) -> Result<i8, io::Error> {
-    Ok(bytes[0] as i8)
+  Ok(bytes[0] as i8)
 }
 
 // Decodes Cassandra `text` data (bytes) into Rust's `Result<String, FromUtf8Error>`.
 pub fn decode_text(bytes: &[u8]) -> Result<String, FromUtf8Error> {
-    Ok(String::from_utf8_lossy(bytes).into_owned())
+  Ok(String::from_utf8_lossy(bytes).into_owned())
 }
 
 // Decodes Cassandra `time` data (bytes) into Rust's `Result<String, FromUtf8Error>`.
 pub fn decode_time(bytes: &[u8]) -> Result<i64, io::Error> {
-    try_i_from_bytes(bytes)
+  try_i_from_bytes(bytes)
 }
 
 // Decodes Cassandra `timeuuid` data (bytes) into Rust's `Result<uuid::Uuid, uuid::BytesError>`
 pub fn decode_timeuuid(bytes: &[u8]) -> Result<uuid::Uuid, uuid::BytesError> {
-    uuid::Uuid::from_slice(bytes)
+  uuid::Uuid::from_slice(bytes)
 }
 
 // Decodes Cassandra `varint` data (bytes) into Rust's `Result<i64, io::Error>`
 pub fn decode_varint(bytes: &[u8]) -> Result<i64, io::Error> {
-    try_i_from_bytes(bytes)
+  try_i_from_bytes(bytes)
 }
 
 // Decodes Cassandra `Udt` data (bytes) into Rust's `Result<Vec<CBytes>, io::Error>`
 // each `CBytes` is encoded type of field of user defined type
 pub fn decode_udt(bytes: &[u8], l: usize) -> Result<Vec<CBytes>, io::Error> {
-    let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
-    let mut udt = Vec::with_capacity(l);
-    for _ in 0..l {
-        let v = CBytes::from_cursor(&mut cursor)
-            .or_else(|err| match err {
-                error::Error::Io(io_err) => {
-                    if io_err.kind() == io::ErrorKind::UnexpectedEof {
-                        Ok(CBytes::new_empty())
-                    } else {
-                        Err(io_err.into())
-                    }
-                }
-                _ => Err(err),
-            }).map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
-        udt.push(v);
-    }
-    Ok(udt)
+  let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
+  let mut udt = Vec::with_capacity(l);
+  for _ in 0..l {
+    let v = CBytes::from_cursor(&mut cursor)
+      .or_else(|err| match err {
+        error::Error::Io(io_err) => {
+          if io_err.kind() == io::ErrorKind::UnexpectedEof {
+            Ok(CBytes::new_empty())
+          } else {
+            Err(io_err.into())
+          }
+        }
+        _ => Err(err),
+      })
+      .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+    udt.push(v);
+  }
+  Ok(udt)
 }
 
 // Decodes Cassandra `Tuple` data (bytes) into Rust's `Result<Vec<CBytes>, io::Error>`
 // each `CBytes` is encoded type of field of user defined type
 pub fn decode_tuple(bytes: &[u8], l: usize) -> Result<Vec<CBytes>, io::Error> {
-    let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
-    let mut udt = Vec::with_capacity(l);
-    for _ in 0..l {
-        let v = CBytes::from_cursor(&mut cursor)
-            .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
-        udt.push(v);
-    }
-    Ok(udt)
+  let mut cursor: io::Cursor<&[u8]> = io::Cursor::new(bytes);
+  let mut udt = Vec::with_capacity(l);
+  for _ in 0..l {
+    let v = CBytes::from_cursor(&mut cursor)
+      .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
+    udt.push(v);
+  }
+  Ok(udt)
 }
 
 #[cfg(test)]
 mod tests {
-    use super::super::super::error::*;
-    use super::super::super::frame::frame_result::*;
-    use super::*;
-    use std::net::IpAddr;
-
-    #[test]
-    fn decode_custom_test() {
-        assert_eq!(decode_custom(b"abcd").unwrap(), "abcd".to_string());
-    }
-
-    #[test]
-    fn decode_ascii_test() {
-        assert_eq!(decode_ascii(b"abcd").unwrap(), "abcd".to_string());
-    }
-
-    #[test]
-    fn decode_varchar_test() {
-        assert_eq!(decode_varchar(b"abcd").unwrap(), "abcd".to_string());
-    }
-
-    #[test]
-    fn decode_bigint_test() {
-        assert_eq!(decode_bigint(&[0, 0, 0, 0, 0, 0, 0, 3]).unwrap(), 3);
-    }
-
-    #[test]
-    fn decode_blob_test() {
-        assert_eq!(
-            decode_blob(&vec![0, 0, 0, 3]).unwrap().into_vec(),
-            vec![0, 0, 0, 3]
-        );
-    }
-
-    #[test]
-    fn decode_boolean_test() {
-        assert_eq!(decode_boolean(&[0]).unwrap(), false);
-        assert_eq!(decode_boolean(&[1]).unwrap(), true);
-        assert!(decode_boolean(&[]).is_err());
-    }
-
-    #[test]
-    fn decode_int_test() {
-        assert_eq!(decode_int(&[0, 0, 0, 3]).unwrap(), 3);
-    }
-
-    #[test]
-    fn decode_date_test() {
-        assert_eq!(decode_date(&[0, 0, 0, 3]).unwrap(), 3);
-    }
-
-    #[test]
-    fn decode_double_test() {
-        let bytes = to_float_big(0.3);
-        assert_eq!(decode_double(bytes.as_slice()).unwrap(), 0.3);
-    }
-
-    #[test]
-    fn decode_float_test() {
-        let bytes = to_float(0.3);
-        assert_eq!(decode_float(bytes.as_slice()).unwrap(), 0.3);
-    }
-
-    #[test]
-    fn decode_inet_test() {
-        let bytes_v4 = &[0, 0, 0, 0];
-        match decode_inet(bytes_v4) {
-            Ok(IpAddr::V4(ref ip)) => assert_eq!(ip.octets(), [0, 0, 0, 0]),
-            _ => panic!("wrong ip v4 address"),
-        }
-
-        let bytes_v6 = &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
-        match decode_inet(bytes_v6) {
-            Ok(IpAddr::V6(ref ip)) => assert_eq!(ip.segments(), [0, 0, 0, 0, 0, 0, 0, 0]),
-            _ => panic!("wrong ip v6 address"),
-        };
-    }
-
-    #[test]
-    fn decode_timestamp_test() {
-        assert_eq!(decode_timestamp(&[0, 0, 0, 0, 0, 0, 0, 3]).unwrap(), 3);
-    }
-
-    #[test]
-    fn decode_list_test() {
-        let results = decode_list(&[0, 0, 0, 1, 0, 0, 0, 2, 1, 2]).unwrap();
-        assert_eq!(results.len(), 1);
-        assert_eq!(results[0].as_plain().unwrap(), vec![1, 2]);
-    }
-
-    #[test]
-    fn decode_set_test() {
-        let results = decode_set(&[0, 0, 0, 1, 0, 0, 0, 2, 1, 2]).unwrap();
-        assert_eq!(results.len(), 1);
-        assert_eq!(results[0].as_plain().unwrap(), vec![1, 2]);
-    }
-
-    #[test]
-    fn decode_map_test() {
-        let results = decode_map(&[0, 0, 0, 1, 0, 0, 0, 2, 1, 2, 0, 0, 0, 2, 2, 1]).unwrap();
-        assert_eq!(results.len(), 1);
-        assert_eq!(results[0].0.as_plain().unwrap(), vec![1, 2]);
-        assert_eq!(results[0].1.as_plain().unwrap(), vec![2, 1]);
-    }
-
-    #[test]
-    fn decode_smallint_test() {
-        assert_eq!(decode_smallint(&[0, 10]).unwrap(), 10);
-    }
-
-    #[test]
-    fn decode_tinyint_test() {
-        assert_eq!(decode_tinyint(&[10]).unwrap(), 10);
-    }
-
-    #[test]
-    fn decode_decimal_test() {
-        assert_eq!(
-            decode_decimal(&[0, 0, 0, 0, 10u8]).unwrap(),
-            Decimal::new(10, 0)
-        );
-
-        assert_eq!(
-            decode_decimal(&[0, 0, 0, 0, 0x00, 0x81]).unwrap(),
-            Decimal::new(129, 0)
-        );
-
-        assert_eq!(
-            decode_decimal(&[0, 0, 0, 0, 0xFF, 0x7F]).unwrap(),
-            Decimal::new(-129, 0)
-        );
-
-        assert_eq!(
-            decode_decimal(&[0, 0, 0, 1, 0x00, 0x81]).unwrap(),
-            Decimal::new(129, 1)
-        );
-
-        assert_eq!(
-            decode_decimal(&[0, 0, 0, 1, 0xFF, 0x7F]).unwrap(),
-            Decimal::new(-129, 1)
-        );
-    }
-
-    #[test]
-    fn decode_text_test() {
-        assert_eq!(decode_text(b"abcba").unwrap(), "abcba");
-    }
-
-    #[test]
-    fn decode_time_test() {
-        assert_eq!(decode_time(&[0, 0, 0, 0, 0, 0, 0, 10]).unwrap(), 10);
-    }
-
-    #[test]
-    fn decode_timeuuid_test() {
-        assert_eq!(
-            decode_timeuuid(&[4, 54, 67, 12, 43, 2, 98, 76, 32, 50, 87, 5, 1, 33, 43, 87])
-                .unwrap()
-                .as_bytes(),
-            &[4, 54, 67, 12, 43, 2, 98, 76, 32, 50, 87, 5, 1, 33, 43, 87]
-        );
-    }
-
-    #[test]
-    fn decode_varint_test() {
-        assert_eq!(decode_varint(&[0x00]).unwrap(), 0);
-        assert_eq!(decode_varint(&[0x01]).unwrap(), 1);
-        assert_eq!(decode_varint(&[0x7F]).unwrap(), 127);
-        assert_eq!(decode_varint(&[0x00, 0x80]).unwrap(), 128);
-        assert_eq!(decode_varint(&[0x00, 0x81]).unwrap(), 129);
-        assert_eq!(decode_varint(&[0xFF]).unwrap(), -1);
-        assert_eq!(decode_varint(&[0x80]).unwrap(), -128);
-        assert_eq!(decode_varint(&[0xFF, 0x7F]).unwrap(), -129);
-    }
-
-    #[test]
-    fn decode_udt_test() {
-        let udt = decode_udt(&[0, 0, 0, 2, 1, 2], 1).unwrap();
-        assert_eq!(udt.len(), 1);
-        assert_eq!(udt[0].as_plain().unwrap(), vec![1, 2]);
-    }
-
-    #[test]
-    fn as_rust_blob_test() {
-        let d_type = DataType { id: ColType::Blob };
-        let data = CBytes::new(vec![1, 2, 3]);
-        assert_eq!(
-            as_rust_type!(d_type, data, Blob)
-                .unwrap()
-                .unwrap()
-                .into_vec(),
-            vec![1, 2, 3]
-        );
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, Blob).is_err());
-    }
-
-    #[test]
-    fn as_rust_string_test() {
-        let type_custom = DataType {
-            id: ColType::Custom,
-        };
-        let type_ascii = DataType { id: ColType::Ascii };
-        let type_varchar = DataType {
-            id: ColType::Varchar,
-        };
-        let data = CBytes::new(b"abc".to_vec());
-        assert_eq!(
-            as_rust_type!(type_custom, data, String).unwrap().unwrap(),
-            "abc"
-        );
-        assert_eq!(
-            as_rust_type!(type_ascii, data, String).unwrap().unwrap(),
-            "abc"
-        );
-        assert_eq!(
-            as_rust_type!(type_varchar, data, String).unwrap().unwrap(),
-            "abc"
-        );
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, String).is_err());
-    }
-
-    #[test]
-    fn as_rust_bool_test() {
-        let type_boolean = DataType {
-            id: ColType::Boolean,
-        };
-        let data_true = CBytes::new(vec![1]);
-        let data_false = CBytes::new(vec![0]);
-        assert_eq!(
-            as_rust_type!(type_boolean, data_true, bool)
-                .unwrap()
-                .unwrap(),
-            true
-        );
-        assert_eq!(
-            as_rust_type!(type_boolean, data_false, bool)
-                .unwrap()
-                .unwrap(),
-            false
-        );
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data_false, bool).is_err());
-    }
-
-    #[test]
-    fn as_rust_i64_test() {
-        let type_bigint = DataType {
-            id: ColType::Bigint,
-        };
-        let type_timestamp = DataType {
-            id: ColType::Timestamp,
-        };
-        let type_time = DataType { id: ColType::Time };
-        let type_varint = DataType {
-            id: ColType::Varint,
-        };
-        let data = CBytes::new(vec![0, 0, 0, 0, 0, 0, 0, 100]);
-        assert_eq!(as_rust_type!(type_bigint, data, i64).unwrap().unwrap(), 100);
-        assert_eq!(
-            as_rust_type!(type_timestamp, data, i64).unwrap().unwrap(),
-            100
-        );
-        assert_eq!(as_rust_type!(type_time, data, i64).unwrap().unwrap(), 100);
-        assert_eq!(as_rust_type!(type_varint, data, i64).unwrap().unwrap(), 100);
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, i64).is_err());
-    }
-
-    #[test]
-    fn as_rust_i32_test() {
-        let type_int = DataType { id: ColType::Int };
-        let type_date = DataType { id: ColType::Date };
-        let data = CBytes::new(vec![0, 0, 0, 100]);
-        assert_eq!(as_rust_type!(type_int, data, i32).unwrap().unwrap(), 100);
-        assert_eq!(as_rust_type!(type_date, data, i32).unwrap().unwrap(), 100);
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, i32).is_err());
-    }
-
-    #[test]
-    fn as_rust_i16_test() {
-        let type_smallint = DataType {
-            id: ColType::Smallint,
-        };
-        let data = CBytes::new(vec![0, 100]);
-        assert_eq!(
-            as_rust_type!(type_smallint, data, i16).unwrap().unwrap(),
-            100
-        );
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, i16).is_err());
-    }
-
-    #[test]
-    fn as_rust_i8_test() {
-        let type_tinyint = DataType {
-            id: ColType::Tinyint,
-        };
-        let data = CBytes::new(vec![100]);
-        assert_eq!(as_rust_type!(type_tinyint, data, i8).unwrap().unwrap(), 100);
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, i8).is_err());
-    }
-
-    #[test]
-    fn as_rust_f64_test() {
-        let type_double = DataType {
-            id: ColType::Double,
-        };
-        let data = CBytes::new(to_float_big(0.1 as f64));
-        assert_eq!(as_rust_type!(type_double, data, f64).unwrap().unwrap(), 0.1);
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, f64).is_err());
-    }
-
-    #[test]
-    fn as_rust_f32_test() {
-        // let type_decimal = DataType { id: ColType::Decimal };
-        let type_float = DataType { id: ColType::Float };
-        let data = CBytes::new(to_float(0.1 as f32));
-        // assert_eq!(as_rust_type!(type_decimal, data, f32).unwrap(), 100.0);
-        assert_eq!(as_rust_type!(type_float, data, f32).unwrap().unwrap(), 0.1);
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, f32).is_err());
-    }
-
-    #[test]
-    fn as_rust_inet_test() {
-        let type_inet = DataType { id: ColType::Inet };
-        let data = CBytes::new(vec![0, 0, 0, 0]);
-
-        match as_rust_type!(type_inet, data, IpAddr) {
-            Ok(Some(IpAddr::V4(ref ip))) => assert_eq!(ip.octets(), [0, 0, 0, 0]),
-            _ => panic!("wrong ip v4 address"),
-        }
-        let wrong_type = DataType { id: ColType::Map };
-        assert!(as_rust_type!(wrong_type, data, f32).is_err());
-    }
-
-    struct DataType {
-        id: ColType,
-    }
+  use super::super::super::error::*;
+  use super::super::super::frame::frame_result::*;
+  use super::*;
+  use std::net::IpAddr;
+
+  #[test]
+  fn decode_custom_test() {
+    assert_eq!(decode_custom(b"abcd").unwrap(), "abcd".to_string());
+  }
+
+  #[test]
+  fn decode_ascii_test() {
+    assert_eq!(decode_ascii(b"abcd").unwrap(), "abcd".to_string());
+  }
+
+  #[test]
+  fn decode_varchar_test() {
+    assert_eq!(decode_varchar(b"abcd").unwrap(), "abcd".to_string());
+  }
+
+  #[test]
+  fn decode_bigint_test() {
+    assert_eq!(decode_bigint(&[0, 0, 0, 0, 0, 0, 0, 3]).unwrap(), 3);
+  }
+
+  #[test]
+  fn decode_blob_test() {
+    assert_eq!(
+      decode_blob(&vec![0, 0, 0, 3]).unwrap().into_vec(),
+      vec![0, 0, 0, 3]
+    );
+  }
+
+  #[test]
+  fn decode_boolean_test() {
+    assert_eq!(decode_boolean(&[0]).unwrap(), false);
+    assert_eq!(decode_boolean(&[1]).unwrap(), true);
+    assert!(decode_boolean(&[]).is_err());
+  }
+
+  #[test]
+  fn decode_int_test() {
+    assert_eq!(decode_int(&[0, 0, 0, 3]).unwrap(), 3);
+  }
+
+  #[test]
+  fn decode_date_test() {
+    assert_eq!(decode_date(&[0, 0, 0, 3]).unwrap(), 3);
+  }
+
+  #[test]
+  fn decode_double_test() {
+    let bytes = to_float_big(0.3);
+    assert_eq!(decode_double(bytes.as_slice()).unwrap(), 0.3);
+  }
+
+  #[test]
+  fn decode_float_test() {
+    let bytes = to_float(0.3);
+    assert_eq!(decode_float(bytes.as_slice()).unwrap(), 0.3);
+  }
+
+  #[test]
+  fn decode_inet_test() {
+    let bytes_v4 = &[0, 0, 0, 0];
+    match decode_inet(bytes_v4) {
+      Ok(IpAddr::V4(ref ip)) => assert_eq!(ip.octets(), [0, 0, 0, 0]),
+      _ => panic!("wrong ip v4 address"),
+    }
+
+    let bytes_v6 = &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+    match decode_inet(bytes_v6) {
+      Ok(IpAddr::V6(ref ip)) => assert_eq!(ip.segments(), [0, 0, 0, 0, 0, 0, 0, 0]),
+      _ => panic!("wrong ip v6 address"),
+    };
+  }
+
+  #[test]
+  fn decode_timestamp_test() {
+    assert_eq!(decode_timestamp(&[0, 0, 0, 0, 0, 0, 0, 3]).unwrap(), 3);
+  }
+
+  #[test]
+  fn decode_list_test() {
+    let results = decode_list(&[0, 0, 0, 1, 0, 0, 0, 2, 1, 2]).unwrap();
+    assert_eq!(results.len(), 1);
+    assert_eq!(results[0].as_plain().unwrap(), vec![1, 2]);
+  }
+
+  #[test]
+  fn decode_set_test() {
+    let results = decode_set(&[0, 0, 0, 1, 0, 0, 0, 2, 1, 2]).unwrap();
+    assert_eq!(results.len(), 1);
+    assert_eq!(results[0].as_plain().unwrap(), vec![1, 2]);
+  }
+
+  #[test]
+  fn decode_map_test() {
+    let results = decode_map(&[0, 0, 0, 1, 0, 0, 0, 2, 1, 2, 0, 0, 0, 2, 2, 1]).unwrap();
+    assert_eq!(results.len(), 1);
+    assert_eq!(results[0].0.as_plain().unwrap(), vec![1, 2]);
+    assert_eq!(results[0].1.as_plain().unwrap(), vec![2, 1]);
+  }
+
+  #[test]
+  fn decode_smallint_test() {
+    assert_eq!(decode_smallint(&[0, 10]).unwrap(), 10);
+  }
+
+  #[test]
+  fn decode_tinyint_test() {
+    assert_eq!(decode_tinyint(&[10]).unwrap(), 10);
+  }
+
+  #[test]
+  fn decode_decimal_test() {
+    assert_eq!(
+      decode_decimal(&[0, 0, 0, 0, 10u8]).unwrap(),
+      Decimal::new(10, 0)
+    );
+
+    assert_eq!(
+      decode_decimal(&[0, 0, 0, 0, 0x00, 0x81]).unwrap(),
+      Decimal::new(129, 0)
+    );
+
+    assert_eq!(
+      decode_decimal(&[0, 0, 0, 0, 0xFF, 0x7F]).unwrap(),
+      Decimal::new(-129, 0)
+    );
+
+    assert_eq!(
+      decode_decimal(&[0, 0, 0, 1, 0x00, 0x81]).unwrap(),
+      Decimal::new(129, 1)
+    );
+
+    assert_eq!(
+      decode_decimal(&[0, 0, 0, 1, 0xFF, 0x7F]).unwrap(),
+      Decimal::new(-129, 1)
+    );
+  }
+
+  #[test]
+  fn decode_text_test() {
+    assert_eq!(decode_text(b"abcba").unwrap(), "abcba");
+  }
+
+  #[test]
+  fn decode_time_test() {
+    assert_eq!(decode_time(&[0, 0, 0, 0, 0, 0, 0, 10]).unwrap(), 10);
+  }
+
+  #[test]
+  fn decode_timeuuid_test() {
+    assert_eq!(
+      decode_timeuuid(&[4, 54, 67, 12, 43, 2, 98, 76, 32, 50, 87, 5, 1, 33, 43, 87])
+        .unwrap()
+        .as_bytes(),
+      &[4, 54, 67, 12, 43, 2, 98, 76, 32, 50, 87, 5, 1, 33, 43, 87]
+    );
+  }
+
+  #[test]
+  fn decode_varint_test() {
+    assert_eq!(decode_varint(&[0x00]).unwrap(), 0);
+    assert_eq!(decode_varint(&[0x01]).unwrap(), 1);
+    assert_eq!(decode_varint(&[0x7F]).unwrap(), 127);
+    assert_eq!(decode_varint(&[0x00, 0x80]).unwrap(), 128);
+    assert_eq!(decode_varint(&[0x00, 0x81]).unwrap(), 129);
+    assert_eq!(decode_varint(&[0xFF]).unwrap(), -1);
+    assert_eq!(decode_varint(&[0x80]).unwrap(), -128);
+    assert_eq!(decode_varint(&[0xFF, 0x7F]).unwrap(), -129);
+  }
+
+  #[test]
+  fn decode_udt_test() {
+    let udt = decode_udt(&[0, 0, 0, 2, 1, 2], 1).unwrap();
+    assert_eq!(udt.len(), 1);
+    assert_eq!(udt[0].as_plain().unwrap(), vec![1, 2]);
+  }
+
+  #[test]
+  fn as_rust_blob_test() {
+    let d_type = DataType { id: ColType::Blob };
+    let data = CBytes::new(vec![1, 2, 3]);
+    assert_eq!(
+      as_rust_type!(d_type, data, Blob)
+        .unwrap()
+        .unwrap()
+        .into_vec(),
+      vec![1, 2, 3]
+    );
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, Blob).is_err());
+  }
+
+  #[test]
+  fn as_rust_string_test() {
+    let type_custom = DataType {
+      id: ColType::Custom,
+    };
+    let type_ascii = DataType { id: ColType::Ascii };
+    let type_varchar = DataType {
+      id: ColType::Varchar,
+    };
+    let data = CBytes::new(b"abc".to_vec());
+    assert_eq!(
+      as_rust_type!(type_custom, data, String).unwrap().unwrap(),
+      "abc"
+    );
+    assert_eq!(
+      as_rust_type!(type_ascii, data, String).unwrap().unwrap(),
+      "abc"
+    );
+    assert_eq!(
+      as_rust_type!(type_varchar, data, String).unwrap().unwrap(),
+      "abc"
+    );
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, String).is_err());
+  }
+
+  #[test]
+  fn as_rust_bool_test() {
+    let type_boolean = DataType {
+      id: ColType::Boolean,
+    };
+    let data_true = CBytes::new(vec![1]);
+    let data_false = CBytes::new(vec![0]);
+    assert_eq!(
+      as_rust_type!(type_boolean, data_true, bool)
+        .unwrap()
+        .unwrap(),
+      true
+    );
+    assert_eq!(
+      as_rust_type!(type_boolean, data_false, bool)
+        .unwrap()
+        .unwrap(),
+      false
+    );
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data_false, bool).is_err());
+  }
+
+  #[test]
+  fn as_rust_i64_test() {
+    let type_bigint = DataType {
+      id: ColType::Bigint,
+    };
+    let type_timestamp = DataType {
+      id: ColType::Timestamp,
+    };
+    let type_time = DataType { id: ColType::Time };
+    let type_varint = DataType {
+      id: ColType::Varint,
+    };
+    let data = CBytes::new(vec![0, 0, 0, 0, 0, 0, 0, 100]);
+    assert_eq!(as_rust_type!(type_bigint, data, i64).unwrap().unwrap(), 100);
+    assert_eq!(
+      as_rust_type!(type_timestamp, data, i64).unwrap().unwrap(),
+      100
+    );
+    assert_eq!(as_rust_type!(type_time, data, i64).unwrap().unwrap(), 100);
+    assert_eq!(as_rust_type!(type_varint, data, i64).unwrap().unwrap(), 100);
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, i64).is_err());
+  }
+
+  #[test]
+  fn as_rust_i32_test() {
+    let type_int = DataType { id: ColType::Int };
+    let type_date = DataType { id: ColType::Date };
+    let data = CBytes::new(vec![0, 0, 0, 100]);
+    assert_eq!(as_rust_type!(type_int, data, i32).unwrap().unwrap(), 100);
+    assert_eq!(as_rust_type!(type_date, data, i32).unwrap().unwrap(), 100);
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, i32).is_err());
+  }
+
+  #[test]
+  fn as_rust_i16_test() {
+    let type_smallint = DataType {
+      id: ColType::Smallint,
+    };
+    let data = CBytes::new(vec![0, 100]);
+    assert_eq!(
+      as_rust_type!(type_smallint, data, i16).unwrap().unwrap(),
+      100
+    );
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, i16).is_err());
+  }
+
+  #[test]
+  fn as_rust_i8_test() {
+    let type_tinyint = DataType {
+      id: ColType::Tinyint,
+    };
+    let data = CBytes::new(vec![100]);
+    assert_eq!(as_rust_type!(type_tinyint, data, i8).unwrap().unwrap(), 100);
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, i8).is_err());
+  }
+
+  #[test]
+  fn as_rust_f64_test() {
+    let type_double = DataType {
+      id: ColType::Double,
+    };
+    let data = CBytes::new(to_float_big(0.1 as f64));
+    assert_eq!(as_rust_type!(type_double, data, f64).unwrap().unwrap(), 0.1);
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, f64).is_err());
+  }
+
+  #[test]
+  fn as_rust_f32_test() {
+    // let type_decimal = DataType { id: ColType::Decimal };
+    let type_float = DataType { id: ColType::Float };
+    let data = CBytes::new(to_float(0.1 as f32));
+    // assert_eq!(as_rust_type!(type_decimal, data, f32).unwrap(), 100.0);
+    assert_eq!(as_rust_type!(type_float, data, f32).unwrap().unwrap(), 0.1);
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, f32).is_err());
+  }
+
+  #[test]
+  fn as_rust_inet_test() {
+    let type_inet = DataType { id: ColType::Inet };
+    let data = CBytes::new(vec![0, 0, 0, 0]);
+
+    match as_rust_type!(type_inet, data, IpAddr) {
+      Ok(Some(IpAddr::V4(ref ip))) => assert_eq!(ip.octets(), [0, 0, 0, 0]),
+      _ => panic!("wrong ip v4 address"),
+    }
+    let wrong_type = DataType { id: ColType::Map };
+    assert!(as_rust_type!(wrong_type, data, f32).is_err());
+  }
+
+  struct DataType {
+    id: ColType,
+  }
 }
diff --git a/src/types/decimal.rs b/src/types/decimal.rs
index eef6ac8..7f678c8 100644
--- a/src/types/decimal.rs
+++ b/src/types/decimal.rs
@@ -1,5 +1,5 @@
 use super::{to_int, to_varint};
-use frame::traits::IntoBytes;
+use crate::frame::traits::IntoBytes;
 
 /// Cassandra Decimal type
 #[derive(Debug, Clone, PartialEq)]
diff --git a/src/types/from_cdrs.rs b/src/types/from_cdrs.rs
index 62cc2c7..804ef4e 100644
--- a/src/types/from_cdrs.rs
+++ b/src/types/from_cdrs.rs
@@ -2,14 +2,14 @@ use std::net::IpAddr;
 use time::Timespec;
 use uuid::Uuid;
 
-use error::Result as CDRSResult;
-use types::blob::Blob;
-use types::decimal::Decimal;
-use types::list::List;
-use types::map::Map;
-use types::tuple::Tuple;
-use types::udt::UDT;
-use types::{AsRustType, ByName, IntoRustByName};
+use crate::error::Result as CDRSResult;
+use crate::types::blob::Blob;
+use crate::types::decimal::Decimal;
+use crate::types::list::List;
+use crate::types::map::Map;
+use crate::types::tuple::Tuple;
+use crate::types::udt::UDT;
+use crate::types::{AsRustType, ByName, IntoRustByName};
 
 pub trait FromCDRS {
   fn from_cdrs<T>(cdrs_type: T) -> CDRSResult<Option<Self>>
diff --git a/src/types/list.rs b/src/types/list.rs
index ace474d..ba1701c 100644
--- a/src/types/list.rs
+++ b/src/types/list.rs
@@ -1,38 +1,38 @@
-use error::{Error, Result};
-use frame::frame_result::{ColType, ColTypeOption, ColTypeOptionValue};
+use crate::error::{Error, Result};
+use crate::frame::frame_result::{ColType, ColTypeOption, ColTypeOptionValue};
+use crate::types::blob::Blob;
+use crate::types::data_serialization_types::*;
+use crate::types::decimal::Decimal;
+use crate::types::map::Map;
+use crate::types::tuple::Tuple;
+use crate::types::udt::UDT;
+use crate::types::{AsRust, AsRustType, CBytes};
 use std::net::IpAddr;
-use types::blob::Blob;
-use types::data_serialization_types::*;
-use types::decimal::Decimal;
-use types::map::Map;
-use types::tuple::Tuple;
-use types::udt::UDT;
-use types::{AsRust, AsRustType, CBytes};
 use uuid::Uuid;
 
 // TODO: consider using pointers to ColTypeOption and Vec<CBytes> instead of owning them.
 #[derive(Debug)]
 pub struct List {
-    /// column spec of the list, i.e. id should be List as it's a list and value should contain
-    /// a type of list items.
-    metadata: ColTypeOption,
-    data: Vec<CBytes>,
+  /// column spec of the list, i.e. id should be List as it's a list and value should contain
+  /// a type of list items.
+  metadata: ColTypeOption,
+  data: Vec<CBytes>,
 }
 
 impl List {
-    pub fn new(data: Vec<CBytes>, metadata: ColTypeOption) -> List {
-        List {
-            metadata: metadata,
-            data: data,
-        }
+  pub fn new(data: Vec<CBytes>, metadata: ColTypeOption) -> List {
+    List {
+      metadata: metadata,
+      data: data,
     }
+  }
 
-    fn map<T, F>(&self, f: F) -> Vec<T>
-    where
-        F: FnMut(&CBytes) -> T,
-    {
-        self.data.iter().map(f).collect()
-    }
+  fn map<T, F>(&self, f: F) -> Vec<T>
+  where
+    F: FnMut(&CBytes) -> T,
+  {
+    self.data.iter().map(f).collect()
+  }
 }
 
 impl AsRust for List {}
diff --git a/src/types/map.rs b/src/types/map.rs
index a346fdd..da801ed 100644
--- a/src/types/map.rs
+++ b/src/types/map.rs
@@ -3,30 +3,30 @@ use std::net::IpAddr;
 use time::Timespec;
 use uuid::Uuid;
 
-use error::{Error, Result};
-use frame::frame_result::{ColType, ColTypeOption, ColTypeOptionValue};
-use types::blob::Blob;
-use types::data_serialization_types::*;
-use types::decimal::Decimal;
-use types::list::List;
-use types::tuple::Tuple;
-use types::udt::UDT;
-use types::{AsRust, AsRustType, CBytes};
+use crate::error::{Error, Result};
+use crate::frame::frame_result::{ColType, ColTypeOption, ColTypeOptionValue};
+use crate::types::blob::Blob;
+use crate::types::data_serialization_types::*;
+use crate::types::decimal::Decimal;
+use crate::types::list::List;
+use crate::types::tuple::Tuple;
+use crate::types::udt::UDT;
+use crate::types::{AsRust, AsRustType, CBytes};
 
 #[derive(Debug)]
 pub struct Map {
-    metadata: ColTypeOption,
-    data: Vec<(CBytes, CBytes)>,
+  metadata: ColTypeOption,
+  data: Vec<(CBytes, CBytes)>,
 }
 
 impl Map {
-    /// Creates new `Map` using the provided data and key and value types.
-    pub fn new(data: Vec<(CBytes, CBytes)>, meta: ColTypeOption) -> Map {
-        Map {
-            metadata: meta,
-            data: data,
-        }
+  /// Creates new `Map` using the provided data and key and value types.
+  pub fn new(data: Vec<(CBytes, CBytes)>, meta: ColTypeOption) -> Map {
+    Map {
+      metadata: meta,
+      data: data,
     }
+  }
 }
 
 impl AsRust for Map {}
diff --git a/src/types/mod.rs b/src/types/mod.rs
index 69a7984..5ffb58f 100644
--- a/src/types/mod.rs
+++ b/src/types/mod.rs
@@ -3,10 +3,10 @@ use std::io;
 use std::io::{Cursor, Read};
 use std::net::SocketAddr;
 
+use crate::error::{column_is_empty_err, Error as CDRSError, Result as CDRSResult};
+use crate::frame::traits::{FromBytes, FromCursor, IntoBytes};
+use crate::types::data_serialization_types::decode_inet;
 use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt};
-use error::{column_is_empty_err, Error as CDRSError, Result as CDRSResult};
-use frame::traits::{FromBytes, FromCursor, IntoBytes};
-use types::data_serialization_types::decode_inet;
 
 pub const LONG_STR_LEN: usize = 4;
 pub const SHORT_LEN: usize = 2;
@@ -26,106 +26,112 @@ pub mod udt;
 pub mod value;
 
 pub mod prelude {
-    pub use error::{Error, Result};
-    pub use frame::{TryFromRow, TryFromUDT};
-    pub use types::blob::Blob;
-    pub use types::decimal::Decimal;
-    pub use types::list::List;
-    pub use types::map::Map;
-    pub use types::rows::Row;
-    pub use types::tuple::Tuple;
-    pub use types::udt::UDT;
-    pub use types::value::{Bytes, Value};
-    pub use types::AsRustType;
+  pub use crate::error::{Error, Result};
+  pub use crate::frame::{TryFromRow, TryFromUDT};
+  pub use crate::types::blob::Blob;
+  pub use crate::types::decimal::Decimal;
+  pub use crate::types::list::List;
+  pub use crate::types::map::Map;
+  pub use crate::types::rows::Row;
+  pub use crate::types::tuple::Tuple;
+  pub use crate::types::udt::UDT;
+  pub use crate::types::value::{Bytes, Value};
+  pub use crate::types::AsRustType;
 }
 
 /// Should be used to represent a single column as a Rust value.
 pub trait AsRustType<T> {
-    fn as_rust_type(&self) -> CDRSResult<Option<T>>;
+  fn as_rust_type(&self) -> CDRSResult<Option<T>>;
 
-    fn as_r_type(&self) -> CDRSResult<T> {
-        self.as_rust_type()
-            .and_then(|op| op.ok_or(CDRSError::from("Value is null or non-set")))
-    }
+  fn as_r_type(&self) -> CDRSResult<T> {
+    self
+      .as_rust_type()
+      .and_then(|op| op.ok_or(CDRSError::from("Value is null or non-set")))
+  }
 }
 
 pub trait AsRust {
-    fn as_rust<R>(&self) -> CDRSResult<Option<R>>
-    where
-        Self: AsRustType<R>,
-    {
-        self.as_rust_type()
-    }
-
-    fn as_r_rust<T>(&self) -> CDRSResult<T>
-    where
-        Self: AsRustType<T>,
-    {
-        self.as_rust()
-            .and_then(|op| op.ok_or("Value is null or non-set".into()))
-    }
+  fn as_rust<R>(&self) -> CDRSResult<Option<R>>
+  where
+    Self: AsRustType<R>,
+  {
+    self.as_rust_type()
+  }
+
+  fn as_r_rust<T>(&self) -> CDRSResult<T>
+  where
+    Self: AsRustType<T>,
+  {
+    self
+      .as_rust()
+      .and_then(|op| op.ok_or("Value is null or non-set".into()))
+  }
 }
 
 /// Should be used to return a single column as Rust value by its name.
 pub trait IntoRustByName<R> {
-    fn get_by_name(&self, name: &str) -> CDRSResult<Option<R>>;
+  fn get_by_name(&self, name: &str) -> CDRSResult<Option<R>>;
 
-    fn get_r_by_name(&self, name: &str) -> CDRSResult<R> {
-        self.get_by_name(name)
-            .and_then(|op| op.ok_or(column_is_empty_err(name)))
-    }
+  fn get_r_by_name(&self, name: &str) -> CDRSResult<R> {
+    self
+      .get_by_name(name)
+      .and_then(|op| op.ok_or(column_is_empty_err(name)))
+  }
 }
 
 pub trait ByName {
-    fn by_name<R>(&self, name: &str) -> CDRSResult<Option<R>>
-    where
-        Self: IntoRustByName<R>,
-    {
-        self.get_by_name(name)
-    }
-
-    fn r_by_name<R>(&self, name: &str) -> CDRSResult<R>
-    where
-        Self: IntoRustByName<R>,
-    {
-        self.by_name(name)
-            .and_then(|op| op.ok_or(column_is_empty_err(name)))
-    }
+  fn by_name<R>(&self, name: &str) -> CDRSResult<Option<R>>
+  where
+    Self: IntoRustByName<R>,
+  {
+    self.get_by_name(name)
+  }
+
+  fn r_by_name<R>(&self, name: &str) -> CDRSResult<R>
+  where
+    Self: IntoRustByName<R>,
+  {
+    self
+      .by_name(name)
+      .and_then(|op| op.ok_or(column_is_empty_err(name)))
+  }
 }
 
 /// Should be used to return a single column as Rust value by its name.
 pub trait IntoRustByIndex<R> {
-    fn get_by_index(&self, index: usize) -> CDRSResult<Option<R>>;
+  fn get_by_index(&self, index: usize) -> CDRSResult<Option<R>>;
 
-    fn get_r_by_index(&self, index: usize) -> CDRSResult<R> {
-        self.get_by_index(index)
-            .and_then(|op| op.ok_or(column_is_empty_err(index)))
-    }
+  fn get_r_by_index(&self, index: usize) -> CDRSResult<R> {
+    self
+      .get_by_index(index)
+      .and_then(|op| op.ok_or(column_is_empty_err(index)))
+  }
 }
 
 pub trait ByIndex {
-    fn by_index<R>(&self, index: usize) -> CDRSResult<Option<R>>
-    where
-        Self: IntoRustByIndex<R>,
-    {
-        self.get_by_index(index)
-    }
-
-    fn r_by_index<R>(&self, index: usize) -> CDRSResult<R>
-    where
-        Self: IntoRustByIndex<R>,
-    {
-        self.by_index(index)
-            .and_then(|op| op.ok_or(column_is_empty_err(index)))
-    }
+  fn by_index<R>(&self, index: usize) -> CDRSResult<Option<R>>
+  where
+    Self: IntoRustByIndex<R>,
+  {
+    self.get_by_index(index)
+  }
+
+  fn r_by_index<R>(&self, index: usize) -> CDRSResult<R>
+  where
+    Self: IntoRustByIndex<R>,
+  {
+    self
+      .by_index(index)
+      .and_then(|op| op.ok_or(column_is_empty_err(index)))
+  }
 }
 
 /// Tries to converts u64 numerical value into array of n bytes.
 pub fn try_to_n_bytes(int: u64, n: usize) -> io::Result<Vec<u8>> {
-    let mut bytes = vec![];
-    try!(bytes.write_uint::<BigEndian>(int, n));
+  let mut bytes = vec![];
+  bytes.write_uint::<BigEndian>(int, n)?;
 
-    Ok(bytes)
+  Ok(bytes)
 }
 
 /// Converts u64 numerical value into array of n bytes
@@ -134,17 +140,17 @@ pub fn try_to_n_bytes(int: u64, n: usize) -> io::Result<Vec<u8>> {
 ///
 /// It panics if given unisigned integer could not be converted in an array of n bytes
 pub fn to_n_bytes(int: u64, n: usize) -> Vec<u8> {
-    try_to_n_bytes(int, n).unwrap()
+  try_to_n_bytes(int, n).unwrap()
 }
 
 pub fn try_i_to_n_bytes(int: i64, n: usize) -> io::Result<Vec<u8>> {
-    let mut bytes = Vec::with_capacity(n);
-    unsafe {
-        bytes.set_len(n);
-    }
-    BigEndian::write_int(&mut bytes, int, n);
+  let mut bytes = Vec::with_capacity(n);
+  unsafe {
+    bytes.set_len(n);
+  }
+  BigEndian::write_int(&mut bytes, int, n);
 
-    Ok(bytes)
+  Ok(bytes)
 }
 
 /// Converts u64 numerical value into array of n bytes
@@ -153,51 +159,51 @@ pub fn try_i_to_n_bytes(int: i64, n: usize) -> io::Result<Vec<u8>> {
 ///
 /// It panics if given integer could not be converted in an array of n bytes
 pub fn i_to_n_bytes(int: i64, n: usize) -> Vec<u8> {
-    try_i_to_n_bytes(int, n).unwrap()
+  try_i_to_n_bytes(int, n).unwrap()
 }
 
 /// Tryies to decode bytes array into `u64`.
 pub fn try_from_bytes(bytes: &[u8]) -> Result<u64, io::Error> {
-    let l = bytes.len();
-    let mut c = Cursor::new(bytes);
-    c.read_uint::<BigEndian>(l)
+  let l = bytes.len();
+  let mut c = Cursor::new(bytes);
+  c.read_uint::<BigEndian>(l)
 }
 
 /// Tryies to decode bytes array into `u16`.
 pub fn try_u16_from_bytes(bytes: &[u8]) -> Result<u16, io::Error> {
-    let mut c = Cursor::new(bytes);
-    c.read_u16::<BigEndian>()
+  let mut c = Cursor::new(bytes);
+  c.read_u16::<BigEndian>()
 }
 
 /// Tries to decode bytes array into `i64`.
 pub fn try_i_from_bytes(bytes: &[u8]) -> Result<i64, io::Error> {
-    let l = bytes.len();
-    let mut c = Cursor::new(bytes);
-    c.read_int::<BigEndian>(l)
+  let l = bytes.len();
+  let mut c = Cursor::new(bytes);
+  c.read_int::<BigEndian>(l)
 }
 
 /// Tries to decode bytes array into `i32`.
 pub fn try_i32_from_bytes(bytes: &[u8]) -> Result<i32, io::Error> {
-    let mut c = Cursor::new(bytes);
-    c.read_i32::<BigEndian>()
+  let mut c = Cursor::new(bytes);
+  c.read_i32::<BigEndian>()
 }
 
 /// Tries to decode bytes array into `i16`.
 pub fn try_i16_from_bytes(bytes: &[u8]) -> Result<i16, io::Error> {
-    let mut c = Cursor::new(bytes);
-    c.read_i16::<BigEndian>()
+  let mut c = Cursor::new(bytes);
+  c.read_i16::<BigEndian>()
 }
 
 /// Tries to decode bytes array into `f32`.
 pub fn try_f32_from_bytes(bytes: &[u8]) -> Result<f32, io::Error> {
-    let mut c = Cursor::new(bytes);
-    c.read_f32::<BigEndian>()
+  let mut c = Cursor::new(bytes);
+  c.read_f32::<BigEndian>()
 }
 
 /// Tries to decode bytes array into `f64`.
 pub fn try_f64_from_bytes(bytes: &[u8]) -> Result<f64, io::Error> {
-    let mut c = Cursor::new(bytes);
-    c.read_f64::<BigEndian>()
+  let mut c = Cursor::new(bytes);
+  c.read_f64::<BigEndian>()
 }
 
 /// Converts byte-array into u64
@@ -206,7 +212,7 @@ pub fn try_f64_from_bytes(bytes: &[u8]) -> Result<f64, io::Error> {
 ///
 /// It panics if given bytes could not be converted into `u64`
 pub fn from_bytes(bytes: &[u8]) -> u64 {
-    try_from_bytes(bytes).unwrap()
+  try_from_bytes(bytes).unwrap()
 }
 
 /// Converts byte-array into i64
@@ -215,7 +221,7 @@ pub fn from_bytes(bytes: &[u8]) -> u64 {
 ///
 /// It panics if given bytes could not be converted into `i64`
 pub fn from_i_bytes(bytes: &[u8]) -> i64 {
-    try_i_from_bytes(bytes).unwrap()
+  try_i_from_bytes(bytes).unwrap()
 }
 
 /// Converts byte-array into u16
@@ -224,7 +230,7 @@ pub fn from_i_bytes(bytes: &[u8]) -> i64 {
 ///
 /// It panics if given bytes could not be converted into `u16`
 pub fn from_u16_bytes(bytes: &[u8]) -> u16 {
-    try_u16_from_bytes(bytes).unwrap()
+  try_u16_from_bytes(bytes).unwrap()
 }
 
 /// Converts number i16 into Cassandra's [short].
@@ -233,11 +239,11 @@ pub fn from_u16_bytes(bytes: &[u8]) -> u16 {
 ///
 /// It panics if given `i16` could not be converted into bytes
 pub fn to_short(int: i16) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is i16
-    let _ = bytes.write_i16::<BigEndian>(int).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is i16
+  let _ = bytes.write_i16::<BigEndian>(int).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Convers integer into Cassandra's [int]
@@ -246,11 +252,11 @@ pub fn to_short(int: i16) -> Vec<u8> {
 ///
 /// It panics if given `i32` could not be converted into bytes
 pub fn to_int(int: i32) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is i16
-    let _ = bytes.write_i32::<BigEndian>(int).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is i16
+  let _ = bytes.write_i32::<BigEndian>(int).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Convers integer into Cassandra's [int]
@@ -259,45 +265,45 @@ pub fn to_int(int: i32) -> Vec<u8> {
 ///
 /// It panics if given `i64` could not be converted into bytes
 pub fn to_bigint(int: i64) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is i64
-    let _ = bytes.write_i64::<BigEndian>(int).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is i64
+  let _ = bytes.write_i64::<BigEndian>(int).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Converts integer into Cassandra's [varint].
 pub fn to_varint(int: i64) -> Vec<u8> {
-    if int == 0 {
-        return vec![0];
-    }
-
-    let mut int_bytes = to_bigint(int);
-    match int.signum() {
-        1 => {
-            int_bytes = int_bytes.into_iter().skip_while(|b| *b == 0x00).collect();
-            if int_bytes
-                .get(0)
-                .map(|b| b.leading_zeros() == 0)
-                .unwrap_or(true)
-            {
-                int_bytes.insert(0, 0x00);
-            }
-        }
-        -1 => {
-            int_bytes = int_bytes.into_iter().skip_while(|b| *b == 0xFF).collect();
-            if int_bytes
-                .get(0)
-                .map(|b| b.leading_zeros() > 0)
-                .unwrap_or(true)
-            {
-                int_bytes.insert(0, 0xFF);
-            }
-        }
-        _ => unreachable!(),
-    }
-
-    int_bytes
+  if int == 0 {
+    return vec![0];
+  }
+
+  let mut int_bytes = to_bigint(int);
+  match int.signum() {
+    1 => {
+      int_bytes = int_bytes.into_iter().skip_while(|b| *b == 0x00).collect();
+      if int_bytes
+        .get(0)
+        .map(|b| b.leading_zeros() == 0)
+        .unwrap_or(true)
+      {
+        int_bytes.insert(0, 0x00);
+      }
+    }
+    -1 => {
+      int_bytes = int_bytes.into_iter().skip_while(|b| *b == 0xFF).collect();
+      if int_bytes
+        .get(0)
+        .map(|b| b.leading_zeros() > 0)
+        .unwrap_or(true)
+      {
+        int_bytes.insert(0, 0xFF);
+      }
+    }
+    _ => unreachable!(),
+  }
+
+  int_bytes
 }
 
 /// Converts number i16 into Cassandra's `short`.
@@ -306,11 +312,11 @@ pub fn to_varint(int: i64) -> Vec<u8> {
 ///
 /// It panics if given `u16` could not be converted into bytes
 pub fn to_u_short(int: u16) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is i16
-    let _ = bytes.write_u16::<BigEndian>(int).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is i16
+  let _ = bytes.write_u16::<BigEndian>(int).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Convers integer into Cassandra's [int]
@@ -319,11 +325,11 @@ pub fn to_u_short(int: u16) -> Vec<u8> {
 ///
 /// It panics if given `u32` could not be converted into bytes
 pub fn to_u(int: u32) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is u64
-    let _ = bytes.write_u32::<BigEndian>(int).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is u64
+  let _ = bytes.write_u32::<BigEndian>(int).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Convers integer into Cassandra's `int`
@@ -332,11 +338,11 @@ pub fn to_u(int: u32) -> Vec<u8> {
 ///
 /// It panics if given `u64` could not be converted into `u64`
 pub fn to_u_big(int: u64) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is u64
-    let _ = bytes.write_u64::<BigEndian>(int).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is u64
+  let _ = bytes.write_u64::<BigEndian>(int).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Converts `f32` into bytes
@@ -345,11 +351,11 @@ pub fn to_u_big(int: u64) -> Vec<u8> {
 ///
 /// It panics if given `f32` could not be converted into bytes
 pub fn to_float(f: f32) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is f32
-    let _ = bytes.write_f32::<BigEndian>(f).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is f32
+  let _ = bytes.write_f32::<BigEndian>(f).unwrap();
 
-    bytes
+  bytes
 }
 
 /// Converts `f64` into array of bytes
@@ -358,157 +364,158 @@ pub fn to_float(f: f32) -> Vec<u8> {
 ///
 /// It panics if given `f63` could not be converted into bytes
 pub fn to_float_big(f: f64) -> Vec<u8> {
-    let mut bytes = vec![];
-    // should not panic as input is f64
-    let _ = bytes.write_f64::<BigEndian>(f).unwrap();
+  let mut bytes = vec![];
+  // should not panic as input is f64
+  let _ = bytes.write_f64::<BigEndian>(f).unwrap();
 
-    bytes
+  bytes
 }
 
 #[derive(Debug, Clone)]
 pub struct CString {
-    string: String,
+  string: String,
 }
 
 impl CString {
-    pub fn new(string: String) -> CString {
-        CString { string: string }
-    }
+  pub fn new(string: String) -> CString {
+    CString { string: string }
+  }
 
-    /// Converts internal value into pointer of `str`.
-    pub fn as_str<'a>(&'a self) -> &'a str {
-        self.string.as_str()
-    }
+  /// Converts internal value into pointer of `str`.
+  pub fn as_str<'a>(&'a self) -> &'a str {
+    self.string.as_str()
+  }
 
-    /// Converts internal value into a plain `String`.
-    pub fn into_plain(self) -> String {
-        self.string
-    }
+  /// Converts internal value into a plain `String`.
+  pub fn into_plain(self) -> String {
+    self.string
+  }
 
-    /// Represents internal value as a `String`.
-    pub fn as_plain(&self) -> String {
-        self.string.clone()
-    }
+  /// Represents internal value as a `String`.
+  pub fn as_plain(&self) -> String {
+    self.string.clone()
+  }
 }
 
 // Implementation for Rust std types
 // Use extended Rust string as Cassandra [string]
 impl IntoBytes for CString {
-    /// Converts into Cassandra byte representation of [string]
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v: Vec<u8> = vec![];
-        let l = self.string.len() as i16;
-        v.extend_from_slice(to_short(l).as_slice());
-        v.extend_from_slice(self.string.as_bytes());
-        v
-    }
+  /// Converts into Cassandra byte representation of [string]
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v: Vec<u8> = vec![];
+    let l = self.string.len() as i16;
+    v.extend_from_slice(to_short(l).as_slice());
+    v.extend_from_slice(self.string.as_bytes());
+    v
+  }
 }
 
 impl FromCursor for CString {
-    /// from_cursor gets Cursor who's position is set such that it should be a start of a [string].
-    /// It reads required number of bytes and returns a String
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CString> {
-        let len_bytes = try!(cursor_next_value(&mut cursor, SHORT_LEN as u64));
-        let len: u64 = try_from_bytes(len_bytes.as_slice())?;
-        let body_bytes = try!(cursor_next_value(&mut cursor, len));
-
-        String::from_utf8(body_bytes)
-            .map_err(Into::into)
-            .map(CString::new)
-    }
+  /// from_cursor gets Cursor who's position is set such that it should be a start of a [string].
+  /// It reads required number of bytes and returns a String
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CString> {
+    let len_bytes = cursor_next_value(&mut cursor, SHORT_LEN as u64)?;
+    let len: u64 = try_from_bytes(len_bytes.as_slice())?;
+    let body_bytes = cursor_next_value(&mut cursor, len)?;
+
+    String::from_utf8(body_bytes)
+      .map_err(Into::into)
+      .map(CString::new)
+  }
 }
 
 #[derive(Debug, Clone)]
 pub struct CStringLong {
-    string: String,
+  string: String,
 }
 
 impl CStringLong {
-    pub fn new(string: String) -> CStringLong {
-        CStringLong { string: string }
-    }
+  pub fn new(string: String) -> CStringLong {
+    CStringLong { string: string }
+  }
 
-    /// Converts internal value into pointer of `str`.
-    pub fn as_str<'a>(&'a self) -> &'a str {
-        self.string.as_str()
-    }
+  /// Converts internal value into pointer of `str`.
+  pub fn as_str<'a>(&'a self) -> &'a str {
+    self.string.as_str()
+  }
 
-    /// Converts internal value into a plain `String`.
-    pub fn into_plain(self) -> String {
-        self.string
-    }
+  /// Converts internal value into a plain `String`.
+  pub fn into_plain(self) -> String {
+    self.string
+  }
 }
 
 // Implementation for Rust std types
 // Use extended Rust string as Cassandra [string]
 impl IntoBytes for CStringLong {
-    /// Converts into Cassandra byte representation of [string]
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v: Vec<u8> = vec![];
-        let l = self.string.len() as i32;
-        v.extend_from_slice(to_int(l).as_slice());
-        v.extend_from_slice(self.string.as_bytes());
-        v
-    }
+  /// Converts into Cassandra byte representation of [string]
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v: Vec<u8> = vec![];
+    let l = self.string.len() as i32;
+    v.extend_from_slice(to_int(l).as_slice());
+    v.extend_from_slice(self.string.as_bytes());
+    v
+  }
 }
 
 impl FromCursor for CStringLong {
-    /// from_cursor gets Cursor who's position is set such that it should be a start of a [string].
-    /// It reads required number of bytes and returns a String
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CStringLong> {
-        let len_bytes = cursor_next_value(&mut cursor, INT_LEN as u64)?;
-        let len: u64 = try_from_bytes(len_bytes.as_slice())?;
-        let body_bytes = cursor_next_value(&mut cursor, len)?;
-
-        String::from_utf8(body_bytes)
-            .map_err(Into::into)
-            .map(CStringLong::new)
-    }
+  /// from_cursor gets Cursor who's position is set such that it should be a start of a [string].
+  /// It reads required number of bytes and returns a String
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CStringLong> {
+    let len_bytes = cursor_next_value(&mut cursor, INT_LEN as u64)?;
+    let len: u64 = try_from_bytes(len_bytes.as_slice())?;
+    let body_bytes = cursor_next_value(&mut cursor, len)?;
+
+    String::from_utf8(body_bytes)
+      .map_err(Into::into)
+      .map(CStringLong::new)
+  }
 }
 
 #[derive(Debug, Clone)]
 pub struct CStringList {
-    pub list: Vec<CString>,
+  pub list: Vec<CString>,
 }
 
 impl CStringList {
-    pub fn into_plain(self) -> Vec<String> {
-        self.list
-            .iter()
-            .map(|string| string.clone().into_plain())
-            .collect()
-    }
+  pub fn into_plain(self) -> Vec<String> {
+    self
+      .list
+      .iter()
+      .map(|string| string.clone().into_plain())
+      .collect()
+  }
 }
 
 impl IntoBytes for CStringList {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut bytes = vec![];
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut bytes = vec![];
 
-        let l = to_short(self.list.len() as i16);
-        bytes.extend_from_slice(l.as_slice());
+    let l = to_short(self.list.len() as i16);
+    bytes.extend_from_slice(l.as_slice());
 
-        bytes = self.list.iter().fold(bytes, |mut _bytes, cstring| {
-            _bytes.extend_from_slice(cstring.into_cbytes().as_slice());
-            _bytes
-        });
+    bytes = self.list.iter().fold(bytes, |mut _bytes, cstring| {
+      _bytes.extend_from_slice(cstring.into_cbytes().as_slice());
+      _bytes
+    });
 
-        bytes
-    }
+    bytes
+  }
 }
 
 impl FromCursor for CStringList {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CStringList> {
-        // TODO: try to use slice instead
-        let mut len_bytes = [0; SHORT_LEN];
-        try!(cursor.read_exact(&mut len_bytes));
-        let len = try_from_bytes(len_bytes.to_vec().as_slice())? as usize;
-        let mut list = Vec::with_capacity(len);
-        for _ in 0..len {
-            list.push(CString::from_cursor(&mut cursor)?);
-        }
-
-        Ok(CStringList { list: list })
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CStringList> {
+    // TODO: try to use slice instead
+    let mut len_bytes = [0; SHORT_LEN];
+    cursor.read_exact(&mut len_bytes)?;
+    let len = try_from_bytes(len_bytes.to_vec().as_slice())? as usize;
+    let mut list = Vec::with_capacity(len);
+    for _ in 0..len {
+      list.push(CString::from_cursor(&mut cursor)?);
     }
+
+    Ok(CStringList { list: list })
+  }
 }
 
 //
@@ -516,385 +523,385 @@ impl FromCursor for CStringList {
 #[derive(Debug, Clone, Hash, PartialEq, Eq)]
 /// The structure that represents Cassandra byte type.
 pub struct CBytes {
-    bytes: Option<Vec<u8>>,
+  bytes: Option<Vec<u8>>,
 }
 
 impl CBytes {
-    pub fn new(bytes: Vec<u8>) -> CBytes {
-        CBytes { bytes: Some(bytes) }
-    }
-
-    /// Creates Cassandra bytes that represent empty or null value
-    pub fn new_empty() -> CBytes {
-        CBytes { bytes: None }
-    }
-
-    /// Converts `CBytes` into a plain array of bytes
-    pub fn into_plain(self) -> Option<Vec<u8>> {
-        self.bytes
-    }
-
-    // TODO: try to replace usage of `as_plain` by `as_slice`
-    pub fn as_plain(&self) -> Option<Vec<u8>> {
-        self.bytes.clone()
-    }
-    pub fn as_slice(&self) -> Option<&[u8]> {
-        match self.bytes {
-            Some(ref v) => Some(v.as_slice()),
-            None => None,
-        }
-        // self.bytes.map(|v| v.as_slice())
-    }
-    pub fn is_empty(&self) -> bool {
-        self.bytes.is_some()
-    }
+  pub fn new(bytes: Vec<u8>) -> CBytes {
+    CBytes { bytes: Some(bytes) }
+  }
+
+  /// Creates Cassandra bytes that represent empty or null value
+  pub fn new_empty() -> CBytes {
+    CBytes { bytes: None }
+  }
+
+  /// Converts `CBytes` into a plain array of bytes
+  pub fn into_plain(self) -> Option<Vec<u8>> {
+    self.bytes
+  }
+
+  // TODO: try to replace usage of `as_plain` by `as_slice`
+  pub fn as_plain(&self) -> Option<Vec<u8>> {
+    self.bytes.clone()
+  }
+  pub fn as_slice(&self) -> Option<&[u8]> {
+    match self.bytes {
+      Some(ref v) => Some(v.as_slice()),
+      None => None,
+    }
+    // self.bytes.map(|v| v.as_slice())
+  }
+  pub fn is_empty(&self) -> bool {
+    self.bytes.is_some()
+  }
 }
 
 impl FromCursor for CBytes {
-    /// from_cursor gets Cursor who's position is set such that it should be a start of a [bytes].
-    /// It reads required number of bytes and returns a CBytes
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CBytes> {
-        let len = CInt::from_cursor(&mut cursor)?;
-        // null or not set value
-        if len < 0 {
-            return Ok(CBytes { bytes: None });
-        }
-
-        cursor_next_value(&mut cursor, len as u64).map(CBytes::new)
+  /// from_cursor gets Cursor who's position is set such that it should be a start of a [bytes].
+  /// It reads required number of bytes and returns a CBytes
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CBytes> {
+    let len = CInt::from_cursor(&mut cursor)?;
+    // null or not set value
+    if len < 0 {
+      return Ok(CBytes { bytes: None });
     }
+
+    cursor_next_value(&mut cursor, len as u64).map(CBytes::new)
+  }
 }
 
 // Use extended Rust Vec<u8> as Cassandra [bytes]
 impl IntoBytes for CBytes {
-    fn into_cbytes(&self) -> Vec<u8> {
-        match self.bytes {
-            Some(ref b) => {
-                let mut v: Vec<u8> = vec![];
-                let l = b.len() as i32;
-                v.extend_from_slice(to_int(l).as_slice());
-                v.extend_from_slice(b.as_slice());
-                v
-            }
-            None => vec![],
-        }
+  fn into_cbytes(&self) -> Vec<u8> {
+    match self.bytes {
+      Some(ref b) => {
+        let mut v: Vec<u8> = vec![];
+        let l = b.len() as i32;
+        v.extend_from_slice(to_int(l).as_slice());
+        v.extend_from_slice(b.as_slice());
+        v
+      }
+      None => vec![],
     }
+  }
 }
 
 /// Cassandra short bytes
 #[derive(Debug, Clone)]
 pub struct CBytesShort {
-    bytes: Option<Vec<u8>>,
+  bytes: Option<Vec<u8>>,
 }
 
 impl CBytesShort {
-    pub fn new(bytes: Vec<u8>) -> CBytesShort {
-        CBytesShort { bytes: Some(bytes) }
-    }
-    /// Converts `CBytesShort` into plain vector of bytes;
-    pub fn into_plain(self) -> Option<Vec<u8>> {
-        self.bytes
-    }
+  pub fn new(bytes: Vec<u8>) -> CBytesShort {
+    CBytesShort { bytes: Some(bytes) }
+  }
+  /// Converts `CBytesShort` into plain vector of bytes;
+  pub fn into_plain(self) -> Option<Vec<u8>> {
+    self.bytes
+  }
 }
 
 impl FromCursor for CBytesShort {
-    /// from_cursor gets Cursor who's position is set such that it should be a start of a [bytes].
-    /// It reads required number of bytes and returns a CBytes
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CBytesShort> {
-        let len = CIntShort::from_cursor(&mut cursor)?;
-
-        if len < 0 {
-            return Ok(CBytesShort { bytes: None });
-        }
-
-        cursor_next_value(&mut cursor, len as u64)
-            .map(CBytesShort::new)
-            .map_err(Into::into)
+  /// from_cursor gets Cursor who's position is set such that it should be a start of a [bytes].
+  /// It reads required number of bytes and returns a CBytes
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CBytesShort> {
+    let len = CIntShort::from_cursor(&mut cursor)?;
+
+    if len < 0 {
+      return Ok(CBytesShort { bytes: None });
     }
+
+    cursor_next_value(&mut cursor, len as u64)
+      .map(CBytesShort::new)
+      .map_err(Into::into)
+  }
 }
 
 // Use extended Rust Vec<u8> as Cassandra [bytes]
 impl IntoBytes for CBytesShort {
-    fn into_cbytes(&self) -> Vec<u8> {
-        match self.bytes {
-            Some(ref b) => {
-                let mut v: Vec<u8> = vec![];
-                let l = b.len() as i16;
-                v.extend_from_slice(to_short(l).as_slice());
-                v.extend_from_slice(b.as_slice());
-                v
-            }
-            None => vec![],
-        }
+  fn into_cbytes(&self) -> Vec<u8> {
+    match self.bytes {
+      Some(ref b) => {
+        let mut v: Vec<u8> = vec![];
+        let l = b.len() as i16;
+        v.extend_from_slice(to_short(l).as_slice());
+        v.extend_from_slice(b.as_slice());
+        v
+      }
+      None => vec![],
     }
+  }
 }
 
 /// Cassandra int type.
 pub type CInt = i32;
 
 impl FromCursor for CInt {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CInt> {
-        let bytes = try!(cursor_next_value(&mut cursor, INT_LEN as u64));
-        try_i32_from_bytes(bytes.as_slice()).map_err(Into::into)
-    }
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CInt> {
+    let bytes = cursor_next_value(&mut cursor, INT_LEN as u64)?;
+    try_i32_from_bytes(bytes.as_slice()).map_err(Into::into)
+  }
 }
 
 /// Cassandra int short type.
 pub type CIntShort = i16;
 
 impl FromCursor for CIntShort {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CIntShort> {
-        let bytes = try!(cursor_next_value(&mut cursor, SHORT_LEN as u64));
-        try_i16_from_bytes(bytes.as_slice()).map_err(Into::into)
-    }
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CIntShort> {
+    let bytes = cursor_next_value(&mut cursor, SHORT_LEN as u64)?;
+    try_i16_from_bytes(bytes.as_slice()).map_err(Into::into)
+  }
 }
 
 // Use extended Rust Vec<u8> as Cassandra [bytes]
 impl FromBytes for Vec<u8> {
-    fn from_bytes(bytes: &[u8]) -> CDRSResult<Vec<u8>> {
-        let mut cursor = Cursor::new(bytes);
-        let len_bytes = cursor_next_value(&mut cursor, SHORT_LEN as u64)?;
-        let len: u64 = try_from_bytes(len_bytes.as_slice())?;
+  fn from_bytes(bytes: &[u8]) -> CDRSResult<Vec<u8>> {
+    let mut cursor = Cursor::new(bytes);
+    let len_bytes = cursor_next_value(&mut cursor, SHORT_LEN as u64)?;
+    let len: u64 = try_from_bytes(len_bytes.as_slice())?;
 
-        cursor_next_value(&mut cursor, len).map_err(Into::into)
-    }
+    cursor_next_value(&mut cursor, len).map_err(Into::into)
+  }
 }
 
 /// The structure wich represets Cassandra [inet]
 /// (https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec#L222).
 #[derive(Debug)]
 pub struct CInet {
-    pub addr: SocketAddr,
+  pub addr: SocketAddr,
 }
 
 impl FromCursor for CInet {
-    fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CInet> {
-        let n = CIntShort::from_cursor(&mut cursor)?;
-        let ip = decode_inet(cursor_next_value(&mut cursor, n as u64)?.as_slice())?;
-        let port = CInt::from_cursor(&mut cursor)?;
-        let socket_addr = SocketAddr::new(ip, port as u16);
+  fn from_cursor(mut cursor: &mut Cursor<&[u8]>) -> CDRSResult<CInet> {
+    let n = CIntShort::from_cursor(&mut cursor)?;
+    let ip = decode_inet(cursor_next_value(&mut cursor, n as u64)?.as_slice())?;
+    let port = CInt::from_cursor(&mut cursor)?;
+    let socket_addr = SocketAddr::new(ip, port as u16);
 
-        Ok(CInet { addr: socket_addr })
-    }
+    Ok(CInet { addr: socket_addr })
+  }
 }
 
 pub fn cursor_next_value(cursor: &mut Cursor<&[u8]>, len: u64) -> CDRSResult<Vec<u8>> {
-    let l = len as usize;
-    let current_position = cursor.position();
-    let mut buff: Vec<u8> = Vec::with_capacity(l);
-    unsafe {
-        buff.set_len(l);
-    }
-    try!(cursor.read_exact(&mut buff));
-    cursor.set_position(current_position + len);
-    Ok(buff)
+  let l = len as usize;
+  let current_position = cursor.position();
+  let mut buff: Vec<u8> = Vec::with_capacity(l);
+  unsafe {
+    buff.set_len(l);
+  }
+  cursor.read_exact(&mut buff)?;
+  cursor.set_position(current_position + len);
+  Ok(buff)
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use frame::traits::{FromCursor, IntoBytes};
-    use std::io::Cursor;
-    use std::mem::transmute;
-
-    // CString
-    #[test]
-    fn test_cstring_new() {
-        let foo = "foo".to_string();
-        let _ = CString::new(foo);
-    }
-
-    #[test]
-    fn test_cstring_as_str() {
-        let foo = "foo".to_string();
-        let cstring = CString::new(foo);
-
-        assert_eq!(cstring.as_str(), "foo");
-    }
-
-    #[test]
-    fn test_cstring_into_plain() {
-        let foo = "foo".to_string();
-        let cstring = CString::new(foo);
-
-        assert_eq!(cstring.into_plain(), "foo".to_string());
-    }
-
-    #[test]
-    fn test_cstring_into_cbytes() {
-        let foo = "foo".to_string();
-        let cstring = CString::new(foo);
-
-        assert_eq!(cstring.into_cbytes(), &[0, 3, 102, 111, 111]);
-    }
-
-    #[test]
-    fn test_cstring_from_cursor() {
-        let a = &[0, 3, 102, 111, 111, 0];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let cstring = CString::from_cursor(&mut cursor).unwrap();
-        assert_eq!(cstring.as_str(), "foo");
-    }
-
-    // CStringLong
-    #[test]
-    fn test_cstringlong_new() {
-        let foo = "foo".to_string();
-        let _ = CStringLong::new(foo);
-    }
-
-    #[test]
-    fn test_cstringlong_as_str() {
-        let foo = "foo".to_string();
-        let cstring = CStringLong::new(foo);
-
-        assert_eq!(cstring.as_str(), "foo");
-    }
-
-    #[test]
-    fn test_cstringlong_into_plain() {
-        let foo = "foo".to_string();
-        let cstring = CStringLong::new(foo);
-
-        assert_eq!(cstring.into_plain(), "foo".to_string());
-    }
-
-    #[test]
-    fn test_cstringlong_into_cbytes() {
-        let foo = "foo".to_string();
-        let cstring = CStringLong::new(foo);
-
-        assert_eq!(cstring.into_cbytes(), &[0, 0, 0, 3, 102, 111, 111]);
-    }
-
-    #[test]
-    fn test_cstringlong_from_cursor() {
-        let a = &[0, 0, 0, 3, 102, 111, 111, 0];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let cstring = CStringLong::from_cursor(&mut cursor).unwrap();
-        assert_eq!(cstring.as_str(), "foo");
-    }
-
-    // CStringList
-    #[test]
-    fn test_cstringlist() {
-        let a = &[0, 2, 0, 3, 102, 111, 111, 0, 3, 102, 111, 111];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let list = CStringList::from_cursor(&mut cursor).unwrap();
-        let plain = list.into_plain();
-        assert_eq!(plain.len(), 2);
-        for s in plain.iter() {
-            assert_eq!(s.as_str(), "foo");
-        }
-    }
-
-    // CBytes
-    #[test]
-    fn test_cbytes_new() {
-        let bytes_vec = vec![1, 2, 3];
-        let _ = CBytes::new(bytes_vec);
-    }
-
-    #[test]
-    fn test_cbytes_into_plain() {
-        let cbytes = CBytes::new(vec![1, 2, 3]);
-        assert_eq!(cbytes.into_plain().unwrap(), &[1, 2, 3]);
-    }
-
-    #[test]
-    fn test_cbytes_from_cursor() {
-        let a = &[0, 0, 0, 3, 1, 2, 3];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let cbytes = CBytes::from_cursor(&mut cursor).unwrap();
-        assert_eq!(cbytes.into_plain().unwrap(), vec![1, 2, 3]);
-    }
-
-    #[test]
-    fn test_cbytes_into_cbytes() {
-        let bytes_vec = vec![1, 2, 3];
-        let cbytes = CBytes::new(bytes_vec);
-        assert_eq!(cbytes.into_cbytes(), vec![0, 0, 0, 3, 1, 2, 3]);
-    }
-
-    // CBytesShort
-    #[test]
-    fn test_cbytesshort_new() {
-        let bytes_vec = vec![1, 2, 3];
-        let _ = CBytesShort::new(bytes_vec);
-    }
-
-    #[test]
-    fn test_cbytesshort_into_plain() {
-        let cbytes = CBytesShort::new(vec![1, 2, 3]);
-        assert_eq!(cbytes.into_plain().unwrap(), vec![1, 2, 3]);
-    }
-
-    #[test]
-    fn test_cbytesshort_from_cursor() {
-        let a = &[0, 3, 1, 2, 3];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let cbytes = CBytesShort::from_cursor(&mut cursor).unwrap();
-        assert_eq!(cbytes.into_plain().unwrap(), vec![1, 2, 3]);
-    }
-
-    #[test]
-    fn test_cbytesshort_into_cbytes() {
-        let bytes_vec: Vec<u8> = vec![1, 2, 3];
-        let cbytes = CBytesShort::new(bytes_vec);
-        assert_eq!(cbytes.into_cbytes(), vec![0, 3, 1, 2, 3]);
-    }
-
-    // CInt
-    #[test]
-    fn test_cint_from_cursor() {
-        let a = &[0, 0, 0, 5];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let i = CInt::from_cursor(&mut cursor).unwrap();
-        assert_eq!(i, 5);
-    }
-
-    // CIntShort
-    #[test]
-    fn test_cintshort_from_cursor() {
-        let a = &[0, 5];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let i = CIntShort::from_cursor(&mut cursor).unwrap();
-        assert_eq!(i, 5);
-    }
-
-    // cursor_next_value
-    #[test]
-    fn test_cursor_next_value() {
-        let a = &[0, 1, 2, 3, 4];
-        let mut cursor: Cursor<&[u8]> = Cursor::new(a);
-        let l: u64 = 3;
-        let val = cursor_next_value(&mut cursor, l).unwrap();
-        assert_eq!(val, vec![0, 1, 2]);
-    }
-
-    #[test]
-    fn test_try_u16_from_bytes() {
-        let bytes: [u8; 2] = unsafe { transmute(12u16.to_be()) }; // or .to_le()
-        let val = try_u16_from_bytes(&bytes);
-        assert_eq!(val.unwrap(), 12u16);
-    }
-
-    #[test]
-    fn test_from_i_bytes() {
-        let bytes: [u8; 8] = unsafe { transmute(12i64.to_be()) }; // or .to_le()
-        let val = from_i_bytes(&bytes);
-        assert_eq!(val, 12i64);
-    }
-
-    #[test]
-    fn test_to_varint() {
-        assert_eq!(to_varint(0), vec![0x00]);
-        assert_eq!(to_varint(1), vec![0x01]);
-        assert_eq!(to_varint(127), vec![0x7F]);
-        assert_eq!(to_varint(128), vec![0x00, 0x80]);
-        assert_eq!(to_varint(129), vec![0x00, 0x81]);
-        assert_eq!(to_varint(-1), vec![0xFF]);
-        assert_eq!(to_varint(-128), vec![0x80]);
-        assert_eq!(to_varint(-129), vec![0xFF, 0x7F]);
-    }
+  use super::*;
+  use crate::frame::traits::{FromCursor, IntoBytes};
+  use std::io::Cursor;
+  use std::mem::transmute;
+
+  // CString
+  #[test]
+  fn test_cstring_new() {
+    let foo = "foo".to_string();
+    let _ = CString::new(foo);
+  }
+
+  #[test]
+  fn test_cstring_as_str() {
+    let foo = "foo".to_string();
+    let cstring = CString::new(foo);
+
+    assert_eq!(cstring.as_str(), "foo");
+  }
+
+  #[test]
+  fn test_cstring_into_plain() {
+    let foo = "foo".to_string();
+    let cstring = CString::new(foo);
+
+    assert_eq!(cstring.into_plain(), "foo".to_string());
+  }
+
+  #[test]
+  fn test_cstring_into_cbytes() {
+    let foo = "foo".to_string();
+    let cstring = CString::new(foo);
+
+    assert_eq!(cstring.into_cbytes(), &[0, 3, 102, 111, 111]);
+  }
+
+  #[test]
+  fn test_cstring_from_cursor() {
+    let a = &[0, 3, 102, 111, 111, 0];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let cstring = CString::from_cursor(&mut cursor).unwrap();
+    assert_eq!(cstring.as_str(), "foo");
+  }
+
+  // CStringLong
+  #[test]
+  fn test_cstringlong_new() {
+    let foo = "foo".to_string();
+    let _ = CStringLong::new(foo);
+  }
+
+  #[test]
+  fn test_cstringlong_as_str() {
+    let foo = "foo".to_string();
+    let cstring = CStringLong::new(foo);
+
+    assert_eq!(cstring.as_str(), "foo");
+  }
+
+  #[test]
+  fn test_cstringlong_into_plain() {
+    let foo = "foo".to_string();
+    let cstring = CStringLong::new(foo);
+
+    assert_eq!(cstring.into_plain(), "foo".to_string());
+  }
+
+  #[test]
+  fn test_cstringlong_into_cbytes() {
+    let foo = "foo".to_string();
+    let cstring = CStringLong::new(foo);
+
+    assert_eq!(cstring.into_cbytes(), &[0, 0, 0, 3, 102, 111, 111]);
+  }
+
+  #[test]
+  fn test_cstringlong_from_cursor() {
+    let a = &[0, 0, 0, 3, 102, 111, 111, 0];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let cstring = CStringLong::from_cursor(&mut cursor).unwrap();
+    assert_eq!(cstring.as_str(), "foo");
+  }
+
+  // CStringList
+  #[test]
+  fn test_cstringlist() {
+    let a = &[0, 2, 0, 3, 102, 111, 111, 0, 3, 102, 111, 111];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let list = CStringList::from_cursor(&mut cursor).unwrap();
+    let plain = list.into_plain();
+    assert_eq!(plain.len(), 2);
+    for s in plain.iter() {
+      assert_eq!(s.as_str(), "foo");
+    }
+  }
+
+  // CBytes
+  #[test]
+  fn test_cbytes_new() {
+    let bytes_vec = vec![1, 2, 3];
+    let _ = CBytes::new(bytes_vec);
+  }
+
+  #[test]
+  fn test_cbytes_into_plain() {
+    let cbytes = CBytes::new(vec![1, 2, 3]);
+    assert_eq!(cbytes.into_plain().unwrap(), &[1, 2, 3]);
+  }
+
+  #[test]
+  fn test_cbytes_from_cursor() {
+    let a = &[0, 0, 0, 3, 1, 2, 3];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let cbytes = CBytes::from_cursor(&mut cursor).unwrap();
+    assert_eq!(cbytes.into_plain().unwrap(), vec![1, 2, 3]);
+  }
+
+  #[test]
+  fn test_cbytes_into_cbytes() {
+    let bytes_vec = vec![1, 2, 3];
+    let cbytes = CBytes::new(bytes_vec);
+    assert_eq!(cbytes.into_cbytes(), vec![0, 0, 0, 3, 1, 2, 3]);
+  }
+
+  // CBytesShort
+  #[test]
+  fn test_cbytesshort_new() {
+    let bytes_vec = vec![1, 2, 3];
+    let _ = CBytesShort::new(bytes_vec);
+  }
+
+  #[test]
+  fn test_cbytesshort_into_plain() {
+    let cbytes = CBytesShort::new(vec![1, 2, 3]);
+    assert_eq!(cbytes.into_plain().unwrap(), vec![1, 2, 3]);
+  }
+
+  #[test]
+  fn test_cbytesshort_from_cursor() {
+    let a = &[0, 3, 1, 2, 3];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let cbytes = CBytesShort::from_cursor(&mut cursor).unwrap();
+    assert_eq!(cbytes.into_plain().unwrap(), vec![1, 2, 3]);
+  }
+
+  #[test]
+  fn test_cbytesshort_into_cbytes() {
+    let bytes_vec: Vec<u8> = vec![1, 2, 3];
+    let cbytes = CBytesShort::new(bytes_vec);
+    assert_eq!(cbytes.into_cbytes(), vec![0, 3, 1, 2, 3]);
+  }
+
+  // CInt
+  #[test]
+  fn test_cint_from_cursor() {
+    let a = &[0, 0, 0, 5];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let i = CInt::from_cursor(&mut cursor).unwrap();
+    assert_eq!(i, 5);
+  }
+
+  // CIntShort
+  #[test]
+  fn test_cintshort_from_cursor() {
+    let a = &[0, 5];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let i = CIntShort::from_cursor(&mut cursor).unwrap();
+    assert_eq!(i, 5);
+  }
+
+  // cursor_next_value
+  #[test]
+  fn test_cursor_next_value() {
+    let a = &[0, 1, 2, 3, 4];
+    let mut cursor: Cursor<&[u8]> = Cursor::new(a);
+    let l: u64 = 3;
+    let val = cursor_next_value(&mut cursor, l).unwrap();
+    assert_eq!(val, vec![0, 1, 2]);
+  }
+
+  #[test]
+  fn test_try_u16_from_bytes() {
+    let bytes: [u8; 2] = unsafe { transmute(12u16.to_be()) }; // or .to_le()
+    let val = try_u16_from_bytes(&bytes);
+    assert_eq!(val.unwrap(), 12u16);
+  }
+
+  #[test]
+  fn test_from_i_bytes() {
+    let bytes: [u8; 8] = unsafe { transmute(12i64.to_be()) }; // or .to_le()
+    let val = from_i_bytes(&bytes);
+    assert_eq!(val, 12i64);
+  }
+
+  #[test]
+  fn test_to_varint() {
+    assert_eq!(to_varint(0), vec![0x00]);
+    assert_eq!(to_varint(1), vec![0x01]);
+    assert_eq!(to_varint(127), vec![0x7F]);
+    assert_eq!(to_varint(128), vec![0x00, 0x80]);
+    assert_eq!(to_varint(129), vec![0x00, 0x81]);
+    assert_eq!(to_varint(-1), vec![0xFF]);
+    assert_eq!(to_varint(-128), vec![0x80]);
+    assert_eq!(to_varint(-129), vec![0xFF, 0x7F]);
+  }
 
 }
diff --git a/src/types/rows.rs b/src/types/rows.rs
index 3249678..aba5e85 100644
--- a/src/types/rows.rs
+++ b/src/types/rows.rs
@@ -2,52 +2,55 @@ use std::net::IpAddr;
 use time::Timespec;
 use uuid::Uuid;
 
-use error::{column_is_empty_err, Error, Result};
-use frame::frame_result::{
-    BodyResResultRows, ColSpec, ColType, ColTypeOption, ColTypeOptionValue, RowsMetadata,
+use crate::error::{column_is_empty_err, Error, Result};
+use crate::frame::frame_result::{
+  BodyResResultRows, ColSpec, ColType, ColTypeOption, ColTypeOptionValue, RowsMetadata,
 };
-use types::blob::Blob;
-use types::data_serialization_types::*;
-use types::decimal::Decimal;
-use types::list::List;
-use types::map::Map;
-use types::tuple::Tuple;
-use types::udt::UDT;
-use types::{ByIndex, ByName, CBytes, IntoRustByIndex, IntoRustByName};
+use crate::types::blob::Blob;
+use crate::types::data_serialization_types::*;
+use crate::types::decimal::Decimal;
+use crate::types::list::List;
+use crate::types::map::Map;
+use crate::types::tuple::Tuple;
+use crate::types::udt::UDT;
+use crate::types::{ByIndex, ByName, CBytes, IntoRustByIndex, IntoRustByName};
 
 #[derive(Clone, Debug)]
 pub struct Row {
-    metadata: RowsMetadata,
-    row_content: Vec<CBytes>,
+  metadata: RowsMetadata,
+  row_content: Vec<CBytes>,
 }
 
 impl Row {
-    pub fn from_frame_body(body: BodyResResultRows) -> Vec<Row> {
-        body.rows_content
-            .iter()
-            .map(|row| Row {
-                metadata: body.metadata.clone(),
-                row_content: row.clone(),
-            }).collect()
-    }
+  pub fn from_frame_body(body: BodyResResultRows) -> Vec<Row> {
+    body
+      .rows_content
+      .iter()
+      .map(|row| Row {
+        metadata: body.metadata.clone(),
+        row_content: row.clone(),
+      })
+      .collect()
+  }
 
-    fn get_col_spec_by_name(&self, name: &str) -> Option<(&ColSpec, &CBytes)> {
-        self.metadata
-            .col_specs
-            .iter()
-            .position(|spec| spec.name.as_str() == name)
-            .map(|i| {
-                let ref col_spec = self.metadata.col_specs[i];
-                let ref data = self.row_content[i];
-                (col_spec, data)
-            })
-    }
+  fn get_col_spec_by_name(&self, name: &str) -> Option<(&ColSpec, &CBytes)> {
+    self
+      .metadata
+      .col_specs
+      .iter()
+      .position(|spec| spec.name.as_str() == name)
+      .map(|i| {
+        let ref col_spec = self.metadata.col_specs[i];
+        let ref data = self.row_content[i];
+        (col_spec, data)
+      })
+  }
 
-    fn get_col_spec_by_index(&self, index: usize) -> Option<(&ColSpec, &CBytes)> {
-        let specs = self.metadata.col_specs.iter();
-        let values = self.row_content.iter();
-        specs.zip(values).nth(index)
-    }
+  fn get_col_spec_by_index(&self, index: usize) -> Option<(&ColSpec, &CBytes)> {
+    let specs = self.metadata.col_specs.iter();
+    let values = self.row_content.iter();
+    specs.zip(values).nth(index)
+  }
 }
 
 impl ByName for Row {}
diff --git a/src/types/tuple.rs b/src/types/tuple.rs
index ac1ff8f..800d592 100644
--- a/src/types/tuple.rs
+++ b/src/types/tuple.rs
@@ -2,60 +2,60 @@ use std::net::IpAddr;
 use time::Timespec;
 use uuid::Uuid;
 
-use error::{column_is_empty_err, Error, Result};
-use frame::frame_result::{CTuple, ColType, ColTypeOption, ColTypeOptionValue};
-use types::blob::Blob;
-use types::data_serialization_types::*;
-use types::decimal::Decimal;
-use types::list::List;
-use types::map::Map;
-use types::udt::UDT;
-use types::{ByIndex, CBytes, IntoRustByIndex};
+use crate::error::{column_is_empty_err, Error, Result};
+use crate::frame::frame_result::{CTuple, ColType, ColTypeOption, ColTypeOptionValue};
+use crate::types::blob::Blob;
+use crate::types::data_serialization_types::*;
+use crate::types::decimal::Decimal;
+use crate::types::list::List;
+use crate::types::map::Map;
+use crate::types::udt::UDT;
+use crate::types::{ByIndex, CBytes, IntoRustByIndex};
 
 use std::hash::{Hash, Hasher};
 
 #[derive(Debug)]
 pub struct Tuple {
-    data: Vec<(ColTypeOption, CBytes)>,
+  data: Vec<(ColTypeOption, CBytes)>,
 }
 
 impl PartialEq for Tuple {
-    fn eq(&self, other: &Tuple) -> bool {
-        if self.data.len() != other.data.len() {
-            return false;
-        }
-        for (s, o) in self.data.iter().zip(other.data.iter()) {
-            if s.1 != o.1 {
-                return false;
-            }
-        }
-        true
+  fn eq(&self, other: &Tuple) -> bool {
+    if self.data.len() != other.data.len() {
+      return false;
     }
+    for (s, o) in self.data.iter().zip(other.data.iter()) {
+      if s.1 != o.1 {
+        return false;
+      }
+    }
+    true
+  }
 }
 
 impl Eq for Tuple {}
 
 impl Hash for Tuple {
-    fn hash<H: Hasher>(&self, state: &mut H) {
-        for data in &self.data {
-            data.1.hash(state);
-        }
+  fn hash<H: Hasher>(&self, state: &mut H) {
+    for data in &self.data {
+      data.1.hash(state);
     }
+  }
 }
 
 impl Tuple {
-    pub fn new<'a>(data: Vec<CBytes>, metadata: &'a CTuple) -> Tuple {
-        let meta_iter = metadata.types.iter();
+  pub fn new<'a>(data: Vec<CBytes>, metadata: &'a CTuple) -> Tuple {
+    let meta_iter = metadata.types.iter();
 
-        let acc = Vec::with_capacity(metadata.types.len());
-        let d = meta_iter.zip(data.iter()).fold(acc, |mut a, v| {
-            let (val_type, val_b) = v;
-            a.push((val_type.clone(), val_b.clone()));
-            a
-        });
+    let acc = Vec::with_capacity(metadata.types.len());
+    let d = meta_iter.zip(data.iter()).fold(acc, |mut a, v| {
+      let (val_type, val_b) = v;
+      a.push((val_type.clone(), val_b.clone()));
+      a
+    });
 
-        Tuple { data: d }
-    }
+    Tuple { data: d }
+  }
 }
 
 impl ByIndex for Tuple {}
diff --git a/src/types/udt.rs b/src/types/udt.rs
index 3c3c1b9..cdf6b66 100644
--- a/src/types/udt.rs
+++ b/src/types/udt.rs
@@ -3,37 +3,37 @@ use std::net::IpAddr;
 use time::Timespec;
 use uuid::Uuid;
 
-use error::{column_is_empty_err, Error, Result};
-use frame::frame_result::{CUdt, ColType, ColTypeOption, ColTypeOptionValue};
-use types::blob::Blob;
-use types::data_serialization_types::*;
-use types::decimal::Decimal;
-use types::list::List;
-use types::map::Map;
-use types::tuple::Tuple;
-use types::{ByName, CBytes, IntoRustByName};
+use crate::error::{column_is_empty_err, Error, Result};
+use crate::frame::frame_result::{CUdt, ColType, ColTypeOption, ColTypeOptionValue};
+use crate::types::blob::Blob;
+use crate::types::data_serialization_types::*;
+use crate::types::decimal::Decimal;
+use crate::types::list::List;
+use crate::types::map::Map;
+use crate::types::tuple::Tuple;
+use crate::types::{ByName, CBytes, IntoRustByName};
 
 #[derive(Clone, Debug)]
 pub struct UDT {
-    data: HashMap<String, (ColTypeOption, CBytes)>,
+  data: HashMap<String, (ColTypeOption, CBytes)>,
 }
 
 impl UDT {
-    pub fn new<'a>(data: Vec<CBytes>, metadata: &'a CUdt) -> UDT {
-        let meta_iter = metadata.descriptions.iter();
+  pub fn new<'a>(data: Vec<CBytes>, metadata: &'a CUdt) -> UDT {
+    let meta_iter = metadata.descriptions.iter();
 
-        let acc: HashMap<String, (ColTypeOption, CBytes)> =
-            HashMap::with_capacity(metadata.descriptions.len());
-        let d = meta_iter.zip(data.iter()).fold(acc, |mut a, v| {
-            let (m, val_b) = v;
-            let &(ref name_b, ref val_type) = m;
-            let name = name_b.as_plain();
-            a.insert(name, (val_type.clone(), val_b.clone()));
-            a
-        });
+    let acc: HashMap<String, (ColTypeOption, CBytes)> =
+      HashMap::with_capacity(metadata.descriptions.len());
+    let d = meta_iter.zip(data.iter()).fold(acc, |mut a, v| {
+      let (m, val_b) = v;
+      let &(ref name_b, ref val_type) = m;
+      let name = name_b.as_plain();
+      a.insert(name, (val_type.clone(), val_b.clone()));
+      a
+    });
 
-        UDT { data: d }
-    }
+    UDT { data: d }
+  }
 }
 
 impl ByName for UDT {}
diff --git a/src/types/value.rs b/src/types/value.rs
index 4706ee1..cb2cbb7 100644
--- a/src/types/value.rs
+++ b/src/types/value.rs
@@ -5,8 +5,8 @@ use std::fmt::Debug;
 use std::hash::Hash;
 use std::net::IpAddr;
 
-use frame::IntoBytes;
-use time::Timespec;
+use crate::frame::IntoBytes;
+use crate::time::Timespec;
 use uuid::Uuid;
 
 use super::blob::Blob;
@@ -16,310 +16,310 @@ use super::*;
 /// Types of Cassandra value: normal value (bits), null value and not-set value
 #[derive(Debug, Clone)]
 pub enum ValueType {
-    Normal(i32),
-    Null,
-    NotSet,
+  Normal(i32),
+  Null,
+  NotSet,
 }
 
 impl IntoBytes for ValueType {
-    fn into_cbytes(&self) -> Vec<u8> {
-        match *self {
-            ValueType::Normal(n) => to_int(n),
-            ValueType::Null => i_to_n_bytes(-1, INT_LEN),
-            ValueType::NotSet => i_to_n_bytes(-2, INT_LEN),
-        }
+  fn into_cbytes(&self) -> Vec<u8> {
+    match *self {
+      ValueType::Normal(n) => to_int(n),
+      ValueType::Null => i_to_n_bytes(-1, INT_LEN),
+      ValueType::NotSet => i_to_n_bytes(-2, INT_LEN),
     }
+  }
 }
 
 /// Cassandra value which could be an array of bytes, null and non-set values.
 #[derive(Debug, Clone)]
 pub struct Value {
-    pub body: Vec<u8>,
-    pub value_type: ValueType,
+  pub body: Vec<u8>,
+  pub value_type: ValueType,
 }
 
 impl Value {
-    /// The factory method which creates a normal type value basing on provided bytes.
-    pub fn new_normal<B>(v: B) -> Value
-    where
-        B: Into<Bytes>,
-    {
-        let bytes = v.into().0;
-        let l = bytes.len() as i32;
-        Value {
-            body: bytes,
-            value_type: ValueType::Normal(l),
-        }
-    }
-
-    /// The factory method which creates null Cassandra value.
-    pub fn new_null() -> Value {
-        Value {
-            body: vec![],
-            value_type: ValueType::Null,
-        }
-    }
-
-    /// The factory method which creates non-set Cassandra value.
-    pub fn new_not_set() -> Value {
-        Value {
-            body: vec![],
-            value_type: ValueType::NotSet,
-        }
-    }
+  /// The factory method which creates a normal type value basing on provided bytes.
+  pub fn new_normal<B>(v: B) -> Value
+  where
+    B: Into<Bytes>,
+  {
+    let bytes = v.into().0;
+    let l = bytes.len() as i32;
+    Value {
+      body: bytes,
+      value_type: ValueType::Normal(l),
+    }
+  }
+
+  /// The factory method which creates null Cassandra value.
+  pub fn new_null() -> Value {
+    Value {
+      body: vec![],
+      value_type: ValueType::Null,
+    }
+  }
+
+  /// The factory method which creates non-set Cassandra value.
+  pub fn new_not_set() -> Value {
+    Value {
+      body: vec![],
+      value_type: ValueType::NotSet,
+    }
+  }
 }
 
 impl IntoBytes for Value {
-    fn into_cbytes(&self) -> Vec<u8> {
-        let mut v = Vec::with_capacity(INT_LEN + self.body.len());
-        v.extend_from_slice(self.value_type.into_cbytes().as_slice());
-        v.extend_from_slice(self.body.as_slice());
-        v
-    }
+  fn into_cbytes(&self) -> Vec<u8> {
+    let mut v = Vec::with_capacity(INT_LEN + self.body.len());
+    v.extend_from_slice(self.value_type.into_cbytes().as_slice());
+    v.extend_from_slice(self.body.as_slice());
+    v
+  }
 }
 
 impl<T: Into<Bytes>> From<T> for Value {
-    fn from(b: T) -> Value {
-        Value::new_normal(b.into())
-    }
+  fn from(b: T) -> Value {
+    Value::new_normal(b.into())
+  }
 }
 
 impl<T: Into<Bytes>> From<Option<T>> for Value {
-    fn from(b: Option<T>) -> Value {
-        match b {
-            Some(b) => Value::new_normal(b.into()),
-            None => Value::new_null(),
-        }
+  fn from(b: Option<T>) -> Value {
+    match b {
+      Some(b) => Value::new_normal(b.into()),
+      None => Value::new_null(),
     }
+  }
 }
 
 #[derive(Debug, Clone)]
 pub struct Bytes(Vec<u8>);
 
 impl Bytes {
-    pub fn new(bytes: Vec<u8>) -> Bytes {
-        Bytes(bytes)
-    }
+  pub fn new(bytes: Vec<u8>) -> Bytes {
+    Bytes(bytes)
+  }
 }
 
 impl Into<Bytes> for String {
-    fn into(self) -> Bytes {
-        Bytes(self.into_bytes())
-    }
+  fn into(self) -> Bytes {
+    Bytes(self.into_bytes())
+  }
 }
 
 impl<'a> Into<Bytes> for &'a str {
-    fn into(self) -> Bytes {
-        Bytes(self.as_bytes().to_vec())
-    }
+  fn into(self) -> Bytes {
+    Bytes(self.as_bytes().to_vec())
+  }
 }
 
 impl Into<Bytes> for i8 {
-    fn into(self) -> Bytes {
-        Bytes(vec![self as u8])
-    }
+  fn into(self) -> Bytes {
+    Bytes(vec![self as u8])
+  }
 }
 
 impl Into<Bytes> for i16 {
-    fn into(self) -> Bytes {
-        Bytes(to_short(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_short(self))
+  }
 }
 
 impl Into<Bytes> for i32 {
-    fn into(self) -> Bytes {
-        Bytes(to_int(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_int(self))
+  }
 }
 
 impl Into<Bytes> for i64 {
-    fn into(self) -> Bytes {
-        Bytes(to_bigint(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_bigint(self))
+  }
 }
 
 impl Into<Bytes> for u8 {
-    fn into(self) -> Bytes {
-        Bytes(vec![self])
-    }
+  fn into(self) -> Bytes {
+    Bytes(vec![self])
+  }
 }
 
 impl Into<Bytes> for u16 {
-    fn into(self) -> Bytes {
-        Bytes(to_u_short(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_u_short(self))
+  }
 }
 
 impl Into<Bytes> for u32 {
-    fn into(self) -> Bytes {
-        Bytes(to_u(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_u(self))
+  }
 }
 
 impl Into<Bytes> for u64 {
-    fn into(self) -> Bytes {
-        Bytes(to_u_big(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_u_big(self))
+  }
 }
 
 impl Into<Bytes> for bool {
-    fn into(self) -> Bytes {
-        if self {
-            Bytes(vec![1])
-        } else {
-            Bytes(vec![0])
-        }
+  fn into(self) -> Bytes {
+    if self {
+      Bytes(vec![1])
+    } else {
+      Bytes(vec![0])
     }
+  }
 }
 
 impl Into<Bytes> for Uuid {
-    fn into(self) -> Bytes {
-        Bytes(self.as_bytes().to_vec())
-    }
+  fn into(self) -> Bytes {
+    Bytes(self.as_bytes().to_vec())
+  }
 }
 
 impl Into<Bytes> for IpAddr {
-    fn into(self) -> Bytes {
-        match self {
-            IpAddr::V4(ip) => Bytes(ip.octets().to_vec()),
-            IpAddr::V6(ip) => Bytes(ip.octets().to_vec()),
-        }
+  fn into(self) -> Bytes {
+    match self {
+      IpAddr::V4(ip) => Bytes(ip.octets().to_vec()),
+      IpAddr::V6(ip) => Bytes(ip.octets().to_vec()),
     }
+  }
 }
 
 impl Into<Bytes> for f32 {
-    fn into(self) -> Bytes {
-        Bytes(to_float(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_float(self))
+  }
 }
 
 impl Into<Bytes> for f64 {
-    fn into(self) -> Bytes {
-        Bytes(to_float_big(self))
-    }
+  fn into(self) -> Bytes {
+    Bytes(to_float_big(self))
+  }
 }
 
 impl Into<Bytes> for Timespec {
-    fn into(self) -> Bytes {
-        let ts: i64 = self.sec * 1_000 + self.nsec as i64 / 1_000_000;
-        Bytes(to_bigint(ts))
-    }
+  fn into(self) -> Bytes {
+    let ts: i64 = self.sec * 1_000 + self.nsec as i64 / 1_000_000;
+    Bytes(to_bigint(ts))
+  }
 }
 
 impl Into<Bytes> for Blob {
-    fn into(self) -> Bytes {
-        Bytes(self.into_vec())
-    }
+  fn into(self) -> Bytes {
+    Bytes(self.into_vec())
+  }
 }
 
 impl Into<Bytes> for Decimal {
-    fn into(self) -> Bytes {
-        Bytes(self.into_cbytes())
-    }
+  fn into(self) -> Bytes {
+    Bytes(self.into_cbytes())
+  }
 }
 
 impl<T: Into<Bytes> + Clone + Debug> From<Vec<T>> for Bytes {
-    fn from(vec: Vec<T>) -> Bytes {
-        let mut bytes: Vec<u8> = vec![];
-        bytes.extend_from_slice(to_int(vec.len() as i32).as_slice());
-        bytes = vec.iter().fold(bytes, |mut acc, v| {
-            let b: Bytes = v.clone().into();
-            acc.extend_from_slice(Value::new_normal(b).into_cbytes().as_slice());
-            acc
-        });
-        Bytes(bytes)
-    }
+  fn from(vec: Vec<T>) -> Bytes {
+    let mut bytes: Vec<u8> = vec![];
+    bytes.extend_from_slice(to_int(vec.len() as i32).as_slice());
+    bytes = vec.iter().fold(bytes, |mut acc, v| {
+      let b: Bytes = v.clone().into();
+      acc.extend_from_slice(Value::new_normal(b).into_cbytes().as_slice());
+      acc
+    });
+    Bytes(bytes)
+  }
 }
 
 impl<K, V> From<HashMap<K, V>> for Bytes
 where
-    K: Into<Bytes> + Clone + Debug + Hash + Eq,
-    V: Into<Bytes> + Clone + Debug,
+  K: Into<Bytes> + Clone + Debug + Hash + Eq,
+  V: Into<Bytes> + Clone + Debug,
 {
-    fn from(map: HashMap<K, V>) -> Bytes {
-        let mut bytes: Vec<u8> = vec![];
-        bytes.extend_from_slice(to_int(map.len() as i32).as_slice());
-        bytes = map.iter().fold(bytes, |mut acc, (k, v)| {
-            let key_bytes: Bytes = k.clone().into();
-            let val_bytes: Bytes = v.clone().into();
-            acc.extend_from_slice(Value::new_normal(key_bytes).into_cbytes().as_slice());
-            acc.extend_from_slice(Value::new_normal(val_bytes).into_cbytes().as_slice());
-            acc
-        });
-        Bytes(bytes)
-    }
+  fn from(map: HashMap<K, V>) -> Bytes {
+    let mut bytes: Vec<u8> = vec![];
+    bytes.extend_from_slice(to_int(map.len() as i32).as_slice());
+    bytes = map.iter().fold(bytes, |mut acc, (k, v)| {
+      let key_bytes: Bytes = k.clone().into();
+      let val_bytes: Bytes = v.clone().into();
+      acc.extend_from_slice(Value::new_normal(key_bytes).into_cbytes().as_slice());
+      acc.extend_from_slice(Value::new_normal(val_bytes).into_cbytes().as_slice());
+      acc
+    });
+    Bytes(bytes)
+  }
 }
 
 #[cfg(test)]
 mod tests {
 
-    use super::*;
-    use frame::traits::IntoBytes;
-
-    #[test]
-    fn test_value_type_into_cbytes() {
-        // normal value types
-        let normal_type = ValueType::Normal(1);
-        assert_eq!(normal_type.into_cbytes(), vec![0, 0, 0, 1]);
-        // null value types
-        let null_type = ValueType::Null;
-        assert_eq!(null_type.into_cbytes(), vec![255, 255, 255, 255]);
-        // not set value types
-        let not_set = ValueType::NotSet;
-        assert_eq!(not_set.into_cbytes(), vec![255, 255, 255, 254])
-    }
-
-    #[test]
-    fn test_new_normal_value() {
-        let plain_value = "hello";
-        let len = plain_value.len() as i32;
-        let normal_value = Value::new_normal(plain_value);
-        assert_eq!(normal_value.body, b"hello");
-        match normal_value.value_type {
-            ValueType::Normal(l) => assert_eq!(l, len),
-            _ => unreachable!(),
-        }
-    }
-
-    #[test]
-    fn test_new_normal_value_all_types() {
-        let _ = Value::new_normal("hello");
-        let _ = Value::new_normal("hello".to_string());
-        let _ = Value::new_normal(1 as u8);
-        let _ = Value::new_normal(1 as u16);
-        let _ = Value::new_normal(1 as u32);
-        let _ = Value::new_normal(1 as u64);
-        let _ = Value::new_normal(1 as i8);
-        let _ = Value::new_normal(1 as i16);
-        let _ = Value::new_normal(1 as i32);
-        let _ = Value::new_normal(1 as i64);
-        let _ = Value::new_normal(true);
-    }
-
-    #[test]
-    fn test_new_null_value() {
-        let null_value = Value::new_null();
-        assert_eq!(null_value.body, vec![]);
-        match null_value.value_type {
-            ValueType::Null => assert!(true),
-            _ => unreachable!(),
-        }
-    }
-
-    #[test]
-    fn test_new_not_set_value() {
-        let not_set_value = Value::new_not_set();
-        assert_eq!(not_set_value.body, vec![]);
-        match not_set_value.value_type {
-            ValueType::NotSet => assert!(true),
-            _ => unreachable!(),
-        }
-    }
-
-    #[test]
-    fn test_value_into_cbytes() {
-        let value = Value::new_normal(1 as u8);
-        assert_eq!(value.into_cbytes(), vec![0, 0, 0, 1, 1]);
-    }
+  use super::*;
+  use crate::frame::traits::IntoBytes;
+
+  #[test]
+  fn test_value_type_into_cbytes() {
+    // normal value types
+    let normal_type = ValueType::Normal(1);
+    assert_eq!(normal_type.into_cbytes(), vec![0, 0, 0, 1]);
+    // null value types
+    let null_type = ValueType::Null;
+    assert_eq!(null_type.into_cbytes(), vec![255, 255, 255, 255]);
+    // not set value types
+    let not_set = ValueType::NotSet;
+    assert_eq!(not_set.into_cbytes(), vec![255, 255, 255, 254])
+  }
+
+  #[test]
+  fn test_new_normal_value() {
+    let plain_value = "hello";
+    let len = plain_value.len() as i32;
+    let normal_value = Value::new_normal(plain_value);
+    assert_eq!(normal_value.body, b"hello");
+    match normal_value.value_type {
+      ValueType::Normal(l) => assert_eq!(l, len),
+      _ => unreachable!(),
+    }
+  }
+
+  #[test]
+  fn test_new_normal_value_all_types() {
+    let _ = Value::new_normal("hello");
+    let _ = Value::new_normal("hello".to_string());
+    let _ = Value::new_normal(1 as u8);
+    let _ = Value::new_normal(1 as u16);
+    let _ = Value::new_normal(1 as u32);
+    let _ = Value::new_normal(1 as u64);
+    let _ = Value::new_normal(1 as i8);
+    let _ = Value::new_normal(1 as i16);
+    let _ = Value::new_normal(1 as i32);
+    let _ = Value::new_normal(1 as i64);
+    let _ = Value::new_normal(true);
+  }
+
+  #[test]
+  fn test_new_null_value() {
+    let null_value = Value::new_null();
+    assert_eq!(null_value.body, vec![]);
+    match null_value.value_type {
+      ValueType::Null => assert!(true),
+      _ => unreachable!(),
+    }
+  }
+
+  #[test]
+  fn test_new_not_set_value() {
+    let not_set_value = Value::new_not_set();
+    assert_eq!(not_set_value.body, vec![]);
+    match not_set_value.value_type {
+      ValueType::NotSet => assert!(true),
+      _ => unreachable!(),
+    }
+  }
+
+  #[test]
+  fn test_value_into_cbytes() {
+    let value = Value::new_normal(1 as u8);
+    assert_eq!(value.into_cbytes(), vec![0, 0, 0, 1, 1]);
+  }
 
 }


Test patch:
diff --git a/tests/collection_types.rs b/tests/collection_types.rs
index 38a19d2..d4e345c 100644
--- a/tests/collection_types.rs
+++ b/tests/collection_types.rs
@@ -1,5 +1,7 @@
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate cdrs;
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate maplit;
 extern crate regex;
@@ -8,417 +10,439 @@ extern crate uuid;
 
 mod common;
 
+#[cfg(feature = "e2e-tests")]
 use common::*;
 
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::blob::Blob;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::list::List;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::map::Map;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::AsRust;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::ByName;
+#[cfg(feature = "e2e-tests")]
 use uuid::Uuid;
 
+#[cfg(feature = "e2e-tests")]
 use std::collections::HashMap;
+#[cfg(feature = "e2e-tests")]
 use std::str::FromStr;
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn list() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_lists \
-               (my_text_list frozen<list<text>> PRIMARY KEY, \
-               my_nested_list list<frozen<list<int>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_list = vec!["text1", "text2", "text3"];
-    let my_nested_list: Vec<Vec<i32>> =
-        vec![vec![1, 2, 3], vec![999, 888, 777, 666, 555], vec![-1, -2]];
-    let values = query_values!(my_text_list.clone(), my_nested_list.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_lists \
-               (my_text_list, my_nested_list) VALUES (?, ?)";
-    session
-        .query_with_values(cql, values)
-        .expect("insert lists error");
-
-    let cql = "SELECT * FROM cdrs_test.test_lists";
-    let rows = session
-        .query(cql)
-        .expect("query lists error")
-        .get_body()
-        .expect("get body with lists error")
-        .into_rows()
-        .expect("converting body with lists into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_list_row: Vec<String> = row.r_by_name::<List>("my_text_list")
-            .expect("my_text_list")
-            .as_r_rust()
-            .expect("my_text_list as rust");
-        let my_nested_list_outer_row: Vec<List> = row.r_by_name::<List>("my_nested_list")
-            .expect("my_nested_list")
-            .as_r_rust()
-            .expect("my_nested_list (outer) as rust");
-        let mut my_nested_list_row = Vec::with_capacity(my_nested_list_outer_row.len());
-        for my_nested_list_inner_row in my_nested_list_outer_row {
-            let my_nested_list_inner_row: Vec<i32> = my_nested_list_inner_row
-                .as_r_rust()
-                .expect("my_nested_list (inner) as rust");
-            my_nested_list_row.push(my_nested_list_inner_row);
-        }
-        assert_eq!(my_text_list_row, vec!["text1", "text2", "text3"]);
-        assert_eq!(my_nested_list_row, my_nested_list);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_lists \
+             (my_text_list frozen<list<text>> PRIMARY KEY, \
+             my_nested_list list<frozen<list<int>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_list = vec!["text1", "text2", "text3"];
+  let my_nested_list: Vec<Vec<i32>> =
+    vec![vec![1, 2, 3], vec![999, 888, 777, 666, 555], vec![-1, -2]];
+  let values = query_values!(my_text_list.clone(), my_nested_list.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_lists \
+             (my_text_list, my_nested_list) VALUES (?, ?)";
+  session
+    .query_with_values(cql, values)
+    .expect("insert lists error");
+
+  let cql = "SELECT * FROM cdrs_test.test_lists";
+  let rows = session
+    .query(cql)
+    .expect("query lists error")
+    .get_body()
+    .expect("get body with lists error")
+    .into_rows()
+    .expect("converting body with lists into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_list_row: Vec<String> = row
+      .r_by_name::<List>("my_text_list")
+      .expect("my_text_list")
+      .as_r_rust()
+      .expect("my_text_list as rust");
+    let my_nested_list_outer_row: Vec<List> = row
+      .r_by_name::<List>("my_nested_list")
+      .expect("my_nested_list")
+      .as_r_rust()
+      .expect("my_nested_list (outer) as rust");
+    let mut my_nested_list_row = Vec::with_capacity(my_nested_list_outer_row.len());
+    for my_nested_list_inner_row in my_nested_list_outer_row {
+      let my_nested_list_inner_row: Vec<i32> = my_nested_list_inner_row
+        .as_r_rust()
+        .expect("my_nested_list (inner) as rust");
+      my_nested_list_row.push(my_nested_list_inner_row);
     }
+    assert_eq!(my_text_list_row, vec!["text1", "text2", "text3"]);
+    assert_eq!(my_nested_list_row, my_nested_list);
+  }
 }
 
 #[test]
 #[ignore]
-#[cfg(feature = "v4")]
+#[cfg(all(feature = "v4", feature = "e2e-tests"))]
 fn list_v4() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_lists_v4 \
-               (my_text_list frozen<list<text>> PRIMARY KEY, \
-               my_nested_list list<frozen<list<smallint>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_list = vec![
-        "text1".to_string(),
-        "text2".to_string(),
-        "text3".to_string(),
-    ];
-    let my_nested_list: Vec<Vec<i16>> =
-        vec![vec![1, 2, 3], vec![999, 888, 777, 666, 555], vec![-1, -2]];
-    let values = query_values!(my_text_list.clone(), my_nested_list.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_lists_v4 \
-               (my_text_list, my_nested_list) VALUES (?, ?)";
-    session.query_with_values(cql, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_lists_v4";
-    let rows = session
-        .query(cql)
-        .expect("query")
-        .get_body()
-        .expect("get body")
-        .into_rows()
-        .expect("into rows");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_list_row: Vec<String> = row.r_by_name::<List>("my_text_list")
-            .expect("my_text_list")
-            .as_r_rust()
-            .expect("my_text_list as rust");
-        let my_nested_list_outer_row: Vec<List> = row.r_by_name::<List>("my_nested_list")
-            .expect("my_nested_list")
-            .as_r_rust()
-            .expect("my_nested_list (outer) as rust");
-        let mut my_nested_list_row = Vec::with_capacity(my_nested_list_outer_row.len());
-        for my_nested_list_inner_row in my_nested_list_outer_row {
-            let my_nested_list_inner_row: Vec<i16> = my_nested_list_inner_row
-                .as_r_rust()
-                .expect("my_nested_list (inner) as rust");
-            my_nested_list_row.push(my_nested_list_inner_row);
-        }
-        assert_eq!(my_text_list_row, my_text_list);
-        assert_eq!(my_nested_list_row, my_nested_list);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_lists_v4 \
+             (my_text_list frozen<list<text>> PRIMARY KEY, \
+             my_nested_list list<frozen<list<smallint>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_list = vec![
+    "text1".to_string(),
+    "text2".to_string(),
+    "text3".to_string(),
+  ];
+  let my_nested_list: Vec<Vec<i16>> =
+    vec![vec![1, 2, 3], vec![999, 888, 777, 666, 555], vec![-1, -2]];
+  let values = query_values!(my_text_list.clone(), my_nested_list.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_lists_v4 \
+             (my_text_list, my_nested_list) VALUES (?, ?)";
+  session.query_with_values(cql, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_lists_v4";
+  let rows = session
+    .query(cql)
+    .expect("query")
+    .get_body()
+    .expect("get body")
+    .into_rows()
+    .expect("into rows");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_list_row: Vec<String> = row
+      .r_by_name::<List>("my_text_list")
+      .expect("my_text_list")
+      .as_r_rust()
+      .expect("my_text_list as rust");
+    let my_nested_list_outer_row: Vec<List> = row
+      .r_by_name::<List>("my_nested_list")
+      .expect("my_nested_list")
+      .as_r_rust()
+      .expect("my_nested_list (outer) as rust");
+    let mut my_nested_list_row = Vec::with_capacity(my_nested_list_outer_row.len());
+    for my_nested_list_inner_row in my_nested_list_outer_row {
+      let my_nested_list_inner_row: Vec<i16> = my_nested_list_inner_row
+        .as_r_rust()
+        .expect("my_nested_list (inner) as rust");
+      my_nested_list_row.push(my_nested_list_inner_row);
     }
+    assert_eq!(my_text_list_row, my_text_list);
+    assert_eq!(my_nested_list_row, my_nested_list);
+  }
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn set() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_sets \
-               (my_text_set frozen<set<text>> PRIMARY KEY, \
-               my_nested_set set<frozen<set<int>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_set = vec![
-        "text1".to_string(),
-        "text2".to_string(),
-        "text3".to_string(),
-    ];
-    let my_nested_set: Vec<Vec<i32>> =
-        vec![vec![-2, -1], vec![1, 2, 3], vec![555, 666, 777, 888, 999]];
-    let values = query_values!(my_text_set.clone(), my_nested_set.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_sets \
-               (my_text_set, my_nested_set) VALUES (?, ?)";
-    session.query_with_values(cql, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_sets";
-    let rows = session
-        .query(cql)
-        .expect("query")
-        .get_body()
-        .expect("get body")
-        .into_rows()
-        .expect("into rows");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_set_row: Vec<String> = row.r_by_name::<List>("my_text_set")
-            .expect("my_text_set")
-            .as_r_rust()
-            .expect("my_text_set as rust");
-        let my_nested_set_outer_row: Vec<List> = row.r_by_name::<List>("my_nested_set")
-            .expect("my_nested_set")
-            .as_r_rust()
-            .expect("my_nested_set (outer) as rust");
-        let mut my_nested_set_row = Vec::with_capacity(my_nested_set_outer_row.len());
-        for my_nested_set_inner_row in my_nested_set_outer_row {
-            let my_nested_set_inner_row: Vec<i32> = my_nested_set_inner_row
-                .as_r_rust()
-                .expect("my_nested_set (inner) as rust");
-            my_nested_set_row.push(my_nested_set_inner_row);
-        }
-        assert_eq!(my_text_set_row, my_text_set);
-        assert_eq!(my_nested_set_row, my_nested_set);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_sets \
+             (my_text_set frozen<set<text>> PRIMARY KEY, \
+             my_nested_set set<frozen<set<int>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_set = vec![
+    "text1".to_string(),
+    "text2".to_string(),
+    "text3".to_string(),
+  ];
+  let my_nested_set: Vec<Vec<i32>> =
+    vec![vec![-2, -1], vec![1, 2, 3], vec![555, 666, 777, 888, 999]];
+  let values = query_values!(my_text_set.clone(), my_nested_set.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_sets \
+             (my_text_set, my_nested_set) VALUES (?, ?)";
+  session.query_with_values(cql, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_sets";
+  let rows = session
+    .query(cql)
+    .expect("query")
+    .get_body()
+    .expect("get body")
+    .into_rows()
+    .expect("into rows");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_set_row: Vec<String> = row
+      .r_by_name::<List>("my_text_set")
+      .expect("my_text_set")
+      .as_r_rust()
+      .expect("my_text_set as rust");
+    let my_nested_set_outer_row: Vec<List> = row
+      .r_by_name::<List>("my_nested_set")
+      .expect("my_nested_set")
+      .as_r_rust()
+      .expect("my_nested_set (outer) as rust");
+    let mut my_nested_set_row = Vec::with_capacity(my_nested_set_outer_row.len());
+    for my_nested_set_inner_row in my_nested_set_outer_row {
+      let my_nested_set_inner_row: Vec<i32> = my_nested_set_inner_row
+        .as_r_rust()
+        .expect("my_nested_set (inner) as rust");
+      my_nested_set_row.push(my_nested_set_inner_row);
     }
+    assert_eq!(my_text_set_row, my_text_set);
+    assert_eq!(my_nested_set_row, my_nested_set);
+  }
 }
 
 #[test]
-#[ignore]
-#[cfg(feature = "v4")]
+#[cfg(all(feature = "v4", feature = "e2e-tests"))]
 fn set_v4() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_sets_v4 \
-               (my_text_set frozen<set<text>> PRIMARY KEY, \
-               my_nested_set set<frozen<set<smallint>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_set = vec![
-        "text1".to_string(),
-        "text2".to_string(),
-        "text3".to_string(),
-    ];
-    let my_nested_set: Vec<Vec<i16>> =
-        vec![vec![-2, -1], vec![1, 2, 3], vec![555, 666, 777, 888, 999]];
-    let values = query_values!(my_text_set.clone(), my_nested_set.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_sets_v4 \
-               (my_text_set, my_nested_set) VALUES (?, ?)";
-    session.query_with_values(cql, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_sets_v4";
-    let rows = session
-        .query(cql)
-        .expect("query")
-        .get_body()
-        .expect("get body")
-        .into_rows()
-        .expect("into rows");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_set_row: Vec<String> = row.r_by_name::<List>("my_text_set")
-            .expect("my_text_set")
-            .as_r_rust()
-            .expect("my_text_set as rust");
-        let my_nested_set_outer_row: Vec<List> = row.r_by_name::<List>("my_nested_set")
-            .expect("my_nested_set")
-            .as_r_rust()
-            .expect("my_nested_set (outer) as rust");
-        let mut my_nested_set_row = Vec::with_capacity(my_nested_set_outer_row.len());
-        for my_nested_set_inner_row in my_nested_set_outer_row {
-            let my_nested_set_inner_row: Vec<i16> = my_nested_set_inner_row
-                .as_r_rust()
-                .expect("my_nested_set (inner) as rust");
-            my_nested_set_row.push(my_nested_set_inner_row);
-        }
-        assert_eq!(my_text_set_row, my_text_set);
-        assert_eq!(my_nested_set_row, my_nested_set);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_sets_v4 \
+             (my_text_set frozen<set<text>> PRIMARY KEY, \
+             my_nested_set set<frozen<set<smallint>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_set = vec![
+    "text1".to_string(),
+    "text2".to_string(),
+    "text3".to_string(),
+  ];
+  let my_nested_set: Vec<Vec<i16>> =
+    vec![vec![-2, -1], vec![1, 2, 3], vec![555, 666, 777, 888, 999]];
+  let values = query_values!(my_text_set.clone(), my_nested_set.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_sets_v4 \
+             (my_text_set, my_nested_set) VALUES (?, ?)";
+  session.query_with_values(cql, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_sets_v4";
+  let rows = session
+    .query(cql)
+    .expect("query")
+    .get_body()
+    .expect("get body")
+    .into_rows()
+    .expect("into rows");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_set_row: Vec<String> = row
+      .r_by_name::<List>("my_text_set")
+      .expect("my_text_set")
+      .as_r_rust()
+      .expect("my_text_set as rust");
+    let my_nested_set_outer_row: Vec<List> = row
+      .r_by_name::<List>("my_nested_set")
+      .expect("my_nested_set")
+      .as_r_rust()
+      .expect("my_nested_set (outer) as rust");
+    let mut my_nested_set_row = Vec::with_capacity(my_nested_set_outer_row.len());
+    for my_nested_set_inner_row in my_nested_set_outer_row {
+      let my_nested_set_inner_row: Vec<i16> = my_nested_set_inner_row
+        .as_r_rust()
+        .expect("my_nested_set (inner) as rust");
+      my_nested_set_row.push(my_nested_set_inner_row);
     }
+    assert_eq!(my_text_set_row, my_text_set);
+    assert_eq!(my_nested_set_row, my_nested_set);
+  }
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn map_without_blob() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_maps_without_blob \
-               (my_key int PRIMARY KEY, \
-               my_text_map map<text, text>, \
-               my_nested_map map<uuid, frozen<map<bigint, int>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_map = hashmap!{
-        "key1".to_string() => "value1".to_string(),
-        "key2".to_string() => "value2".to_string(),
-        "key3".to_string() => "value3".to_string(),
-    };
-    let my_nested_map: HashMap<Uuid, HashMap<i64, i32>> = hashmap!{
-        Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap() => hashmap!{
-            1 => 1,
-            2 => 2,
-        },
-        Uuid::from_str("687d7677-dbf0-4d25-8cf3-e5d9185bba0b").unwrap() => hashmap!{
-            1 => 1,
-        },
-        Uuid::from_str("c4dc6e8b-758a-4af4-ab00-ec356fb688d9").unwrap() => hashmap!{
-            1 => 1,
-            2 => 2,
-            3 => 3,
-        },
-    };
-    let values = query_values!(0i32, my_text_map.clone(), my_nested_map.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_maps_without_blob \
-               (my_key, my_text_map, my_nested_map) VALUES (?, ?, ?)";
-    session.query_with_values(cql, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_maps_without_blob";
-    let rows = session
-        .query(cql)
-        .expect("query")
-        .get_body()
-        .expect("get body")
-        .into_rows()
-        .expect("into rows");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_map_row: HashMap<String, String> = row.r_by_name::<Map>("my_text_map")
-            .expect("my_text_map")
-            .as_r_rust()
-            .expect("my_text_map as rust");
-        let my_nested_map_outer_row: HashMap<Uuid, Map> = row.r_by_name::<Map>("my_nested_map")
-            .expect("my_nested_map")
-            .as_r_rust()
-            .expect("my_nested_map (outer) as rust");
-        let mut my_nested_map_row = HashMap::with_capacity(my_nested_map_outer_row.len());
-        for (index, my_nested_map_inner_row) in my_nested_map_outer_row {
-            let my_nested_map_inner_row: HashMap<i64, i32> = my_nested_map_inner_row
-                .as_r_rust()
-                .expect("my_nested_map (inner) as rust");
-            my_nested_map_row.insert(index, my_nested_map_inner_row);
-        }
-        assert_eq!(my_text_map_row, my_text_map);
-        assert_eq!(my_nested_map_row, my_nested_map);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_maps_without_blob \
+             (my_key int PRIMARY KEY, \
+             my_text_map map<text, text>, \
+             my_nested_map map<uuid, frozen<map<bigint, int>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_map = hashmap! {
+      "key1".to_string() => "value1".to_string(),
+      "key2".to_string() => "value2".to_string(),
+      "key3".to_string() => "value3".to_string(),
+  };
+  let my_nested_map: HashMap<Uuid, HashMap<i64, i32>> = hashmap! {
+      Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap() => hashmap!{
+          1 => 1,
+          2 => 2,
+      },
+      Uuid::from_str("687d7677-dbf0-4d25-8cf3-e5d9185bba0b").unwrap() => hashmap!{
+          1 => 1,
+      },
+      Uuid::from_str("c4dc6e8b-758a-4af4-ab00-ec356fb688d9").unwrap() => hashmap!{
+          1 => 1,
+          2 => 2,
+          3 => 3,
+      },
+  };
+  let values = query_values!(0i32, my_text_map.clone(), my_nested_map.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_maps_without_blob \
+             (my_key, my_text_map, my_nested_map) VALUES (?, ?, ?)";
+  session.query_with_values(cql, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_maps_without_blob";
+  let rows = session
+    .query(cql)
+    .expect("query")
+    .get_body()
+    .expect("get body")
+    .into_rows()
+    .expect("into rows");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_map_row: HashMap<String, String> = row
+      .r_by_name::<Map>("my_text_map")
+      .expect("my_text_map")
+      .as_r_rust()
+      .expect("my_text_map as rust");
+    let my_nested_map_outer_row: HashMap<Uuid, Map> = row
+      .r_by_name::<Map>("my_nested_map")
+      .expect("my_nested_map")
+      .as_r_rust()
+      .expect("my_nested_map (outer) as rust");
+    let mut my_nested_map_row = HashMap::with_capacity(my_nested_map_outer_row.len());
+    for (index, my_nested_map_inner_row) in my_nested_map_outer_row {
+      let my_nested_map_inner_row: HashMap<i64, i32> = my_nested_map_inner_row
+        .as_r_rust()
+        .expect("my_nested_map (inner) as rust");
+      my_nested_map_row.insert(index, my_nested_map_inner_row);
     }
+    assert_eq!(my_text_map_row, my_text_map);
+    assert_eq!(my_nested_map_row, my_nested_map);
+  }
 }
 
 #[test]
-#[ignore]
-#[cfg(feature = "v4")]
+#[cfg(all(feature = "v4", feature = "e2e-tests"))]
 fn map_without_blob_v4() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_maps_without_blob_v4 \
-               (my_text_map frozen<map<text, text>> PRIMARY KEY, \
-               my_nested_map map<uuid, frozen<map<bigint, tinyint>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_map = hashmap!{
-        "key1".to_string() => "value1".to_string(),
-        "key2".to_string() => "value2".to_string(),
-        "key3".to_string() => "value3".to_string(),
-    };
-    let my_nested_map: HashMap<Uuid, HashMap<i64, i8>> = hashmap!{
-        Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap() => hashmap!{
-            1 => 1,
-            2 => 2,
-        },
-        Uuid::from_str("687d7677-dbf0-4d25-8cf3-e5d9185bba0b").unwrap() => hashmap!{
-            1 => 1,
-        },
-        Uuid::from_str("c4dc6e8b-758a-4af4-ab00-ec356fb688d9").unwrap() => hashmap!{
-            1 => 1,
-            2 => 2,
-            3 => 3,
-        },
-    };
-    let values = query_values!(my_text_map.clone(), my_nested_map.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_maps_without_blob_v4 \
-               (my_text_map, my_nested_map) VALUES (?, ?)";
-    session.query_with_values(cql, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_maps_without_blob_v4";
-    let rows = session
-        .query(cql)
-        .expect("query")
-        .get_body()
-        .expect("get body")
-        .into_rows()
-        .expect("into rows");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_map_row: HashMap<String, String> = row.r_by_name::<Map>("my_text_map")
-            .expect("my_text_map")
-            .as_r_rust()
-            .expect("my_text_map as rust");
-        let my_nested_map_outer_row: HashMap<Uuid, Map> = row.r_by_name::<Map>("my_nested_map")
-            .expect("my_nested_map")
-            .as_r_rust()
-            .expect("my_nested_map (outer) as rust");
-        let mut my_nested_map_row = HashMap::with_capacity(my_nested_map_outer_row.len());
-        for (index, my_nested_map_inner_row) in my_nested_map_outer_row {
-            let my_nested_map_inner_row: HashMap<i64, i8> = my_nested_map_inner_row
-                .as_r_rust()
-                .expect("my_nested_map (inner) as rust");
-            my_nested_map_row.insert(index, my_nested_map_inner_row);
-        }
-        assert_eq!(my_text_map_row, my_text_map);
-        assert_eq!(my_nested_map_row, my_nested_map);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_maps_without_blob_v4 \
+             (my_text_map frozen<map<text, text>> PRIMARY KEY, \
+             my_nested_map map<uuid, frozen<map<bigint, tinyint>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_map = hashmap! {
+      "key1".to_string() => "value1".to_string(),
+      "key2".to_string() => "value2".to_string(),
+      "key3".to_string() => "value3".to_string(),
+  };
+  let my_nested_map: HashMap<Uuid, HashMap<i64, i8>> = hashmap! {
+      Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap() => hashmap!{
+          1 => 1,
+          2 => 2,
+      },
+      Uuid::from_str("687d7677-dbf0-4d25-8cf3-e5d9185bba0b").unwrap() => hashmap!{
+          1 => 1,
+      },
+      Uuid::from_str("c4dc6e8b-758a-4af4-ab00-ec356fb688d9").unwrap() => hashmap!{
+          1 => 1,
+          2 => 2,
+          3 => 3,
+      },
+  };
+  let values = query_values!(my_text_map.clone(), my_nested_map.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_maps_without_blob_v4 \
+             (my_text_map, my_nested_map) VALUES (?, ?)";
+  session.query_with_values(cql, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_maps_without_blob_v4";
+  let rows = session
+    .query(cql)
+    .expect("query")
+    .get_body()
+    .expect("get body")
+    .into_rows()
+    .expect("into rows");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_map_row: HashMap<String, String> = row
+      .r_by_name::<Map>("my_text_map")
+      .expect("my_text_map")
+      .as_r_rust()
+      .expect("my_text_map as rust");
+    let my_nested_map_outer_row: HashMap<Uuid, Map> = row
+      .r_by_name::<Map>("my_nested_map")
+      .expect("my_nested_map")
+      .as_r_rust()
+      .expect("my_nested_map (outer) as rust");
+    let mut my_nested_map_row = HashMap::with_capacity(my_nested_map_outer_row.len());
+    for (index, my_nested_map_inner_row) in my_nested_map_outer_row {
+      let my_nested_map_inner_row: HashMap<i64, i8> = my_nested_map_inner_row
+        .as_r_rust()
+        .expect("my_nested_map (inner) as rust");
+      my_nested_map_row.insert(index, my_nested_map_inner_row);
     }
+    assert_eq!(my_text_map_row, my_text_map);
+    assert_eq!(my_nested_map_row, my_nested_map);
+  }
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn map() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_maps \
-               (my_text_map frozen<map<text, text>> PRIMARY KEY, \
-               my_nested_map map<uuid, frozen<map<bigint, blob>>>)";
-    let session = setup(cql).expect("setup");
-
-    let my_text_map = hashmap!{
-        "key1".to_string() => "value1".to_string(),
-        "key2".to_string() => "value2".to_string(),
-        "key3".to_string() => "value3".to_string(),
-    };
-    let my_nested_map: HashMap<Uuid, HashMap<i64, Blob>> = hashmap!{
-        Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap() => hashmap!{
-            1 => vec![52, 121, 209, 200, 81, 118, 181, 17].into(),
-            2 => vec![226, 90, 51, 10, 26, 87, 141, 61].into(),
-        },
-        Uuid::from_str("687d7677-dbf0-4d25-8cf3-e5d9185bba0b").unwrap() => hashmap!{
-            1 => vec![224, 155, 148, 6, 217, 96, 120, 38].into(),
-        },
-        Uuid::from_str("c4dc6e8b-758a-4af4-ab00-ec356fb688d9").unwrap() => hashmap!{
-            1 => vec![164, 238, 196, 10, 149, 169, 145, 239].into(),
-            2 => vec![250, 87, 119, 134, 105, 236, 240, 64].into(),
-            3 => vec![72, 81, 26, 173, 107, 96, 38, 91].into(),
-        },
-    };
-    let values = query_values!(my_text_map.clone(), my_nested_map.clone());
-
-    let cql = "INSERT INTO cdrs_test.test_maps \
-               (my_text_map, my_nested_map) VALUES (?, ?)";
-    session.query_with_values(cql, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_maps";
-    let rows = session
-        .query(cql)
-        .expect("query")
-        .get_body()
-        .expect("get body")
-        .into_rows()
-        .expect("into rows");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_text_map_row: HashMap<String, String> = row.r_by_name::<Map>("my_text_map")
-            .expect("my_text_map")
-            .as_r_rust()
-            .expect("my_text_map as rust");
-        let my_nested_map_outer_row: HashMap<Uuid, Map> = row.r_by_name::<Map>("my_nested_map")
-            .expect("my_nested_map")
-            .as_r_rust()
-            .expect("my_nested_map (outer) as rust");
-        let mut my_nested_map_row = HashMap::with_capacity(my_nested_map_outer_row.len());
-        for (index, my_nested_map_inner_row) in my_nested_map_outer_row {
-            let my_nested_map_inner_row: HashMap<i64, Blob> = my_nested_map_inner_row
-                .as_r_rust()
-                .expect("my_nested_map (inner) as rust");
-            my_nested_map_row.insert(index, my_nested_map_inner_row);
-        }
-        assert_eq!(my_text_map_row, my_text_map);
-        assert_eq!(my_nested_map_row, my_nested_map);
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_maps \
+             (my_text_map frozen<map<text, text>> PRIMARY KEY, \
+             my_nested_map map<uuid, frozen<map<bigint, blob>>>)";
+  let session = setup(cql).expect("setup");
+
+  let my_text_map = hashmap! {
+      "key1".to_string() => "value1".to_string(),
+      "key2".to_string() => "value2".to_string(),
+      "key3".to_string() => "value3".to_string(),
+  };
+  let my_nested_map: HashMap<Uuid, HashMap<i64, Blob>> = hashmap! {
+      Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap() => hashmap!{
+          1 => vec![52, 121, 209, 200, 81, 118, 181, 17].into(),
+          2 => vec![226, 90, 51, 10, 26, 87, 141, 61].into(),
+      },
+      Uuid::from_str("687d7677-dbf0-4d25-8cf3-e5d9185bba0b").unwrap() => hashmap!{
+          1 => vec![224, 155, 148, 6, 217, 96, 120, 38].into(),
+      },
+      Uuid::from_str("c4dc6e8b-758a-4af4-ab00-ec356fb688d9").unwrap() => hashmap!{
+          1 => vec![164, 238, 196, 10, 149, 169, 145, 239].into(),
+          2 => vec![250, 87, 119, 134, 105, 236, 240, 64].into(),
+          3 => vec![72, 81, 26, 173, 107, 96, 38, 91].into(),
+      },
+  };
+  let values = query_values!(my_text_map.clone(), my_nested_map.clone());
+
+  let cql = "INSERT INTO cdrs_test.test_maps \
+             (my_text_map, my_nested_map) VALUES (?, ?)";
+  session.query_with_values(cql, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_maps";
+  let rows = session
+    .query(cql)
+    .expect("query")
+    .get_body()
+    .expect("get body")
+    .into_rows()
+    .expect("into rows");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_text_map_row: HashMap<String, String> = row
+      .r_by_name::<Map>("my_text_map")
+      .expect("my_text_map")
+      .as_r_rust()
+      .expect("my_text_map as rust");
+    let my_nested_map_outer_row: HashMap<Uuid, Map> = row
+      .r_by_name::<Map>("my_nested_map")
+      .expect("my_nested_map")
+      .as_r_rust()
+      .expect("my_nested_map (outer) as rust");
+    let mut my_nested_map_row = HashMap::with_capacity(my_nested_map_outer_row.len());
+    for (index, my_nested_map_inner_row) in my_nested_map_outer_row {
+      let my_nested_map_inner_row: HashMap<i64, Blob> = my_nested_map_inner_row
+        .as_r_rust()
+        .expect("my_nested_map (inner) as rust");
+      my_nested_map_row.insert(index, my_nested_map_inner_row);
     }
+    assert_eq!(my_text_map_row, my_text_map);
+    assert_eq!(my_nested_map_row, my_nested_map);
+  }
 }
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 46601a6..8440598 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -1,19 +1,30 @@
+#[cfg(feature = "e2e-tests")]
 use cdrs::authenticators::NoneAuthenticator;
+#[cfg(feature = "e2e-tests")]
 use cdrs::cluster::session::{new as new_session, Session};
+#[cfg(feature = "e2e-tests")]
 use cdrs::cluster::{ClusterTcpConfig, NodeTcpConfigBuilder, TcpConnectionPool};
+#[cfg(feature = "e2e-tests")]
 use cdrs::error::Result;
+#[cfg(feature = "e2e-tests")]
 use cdrs::load_balancing::RoundRobin;
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use regex::Regex;
 
+#[cfg(feature = "e2e-tests")]
 const ADDR: &'static str = "127.0.0.1:9042";
 
+#[cfg(feature = "e2e-tests")]
 type CurrentSession = Session<RoundRobin<TcpConnectionPool<NoneAuthenticator>>>;
 
+#[cfg(feature = "e2e-tests")]
 pub fn setup(create_table_cql: &'static str) -> Result<CurrentSession> {
   setup_multiple(&[create_table_cql])
 }
 
+#[cfg(feature = "e2e-tests")]
 pub fn setup_multiple(create_cqls: &[&'static str]) -> Result<CurrentSession> {
   let node = NodeTcpConfigBuilder::new(ADDR, NoneAuthenticator {}).build();
   let cluster_config = ClusterTcpConfig(vec![node]);
diff --git a/tests/derive_traits.rs b/tests/derive_traits.rs
index 277ed3d..bbd062b 100644
--- a/tests/derive_traits.rs
+++ b/tests/derive_traits.rs
@@ -1,7 +1,10 @@
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate cdrs;
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate cdrs_helpers_derive;
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate maplit;
 extern crate regex;
@@ -10,28 +13,45 @@ extern crate uuid;
 
 mod common;
 
+#[cfg(feature = "e2e-tests")]
 use common::*;
 
+#[cfg(feature = "e2e-tests")]
 use cdrs::error::Result as CDRSResult;
+#[cfg(feature = "e2e-tests")]
 use cdrs::frame::IntoBytes;
+#[cfg(feature = "e2e-tests")]
 use cdrs::frame::{TryFromRow, TryFromUDT};
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryValues;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::blob::Blob;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::from_cdrs::FromCDRSByName;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::map::Map;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::rows::Row;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::udt::UDT;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::value::{Bytes, Value};
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::{AsRust, AsRustType, IntoRustByName};
+#[cfg(feature = "e2e-tests")]
 use std::str::FromStr;
+#[cfg(feature = "e2e-tests")]
 use time::Timespec;
+#[cfg(feature = "e2e-tests")]
 use uuid::Uuid;
 
+#[cfg(feature = "e2e-tests")]
 use std::collections::HashMap;
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn simple_udt() {
   let create_type_cql = "CREATE TYPE IF NOT EXISTS cdrs_test.derive_udt (my_text text)";
   let create_table_cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_derived_udt \
@@ -89,7 +109,7 @@ fn simple_udt() {
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn nested_udt() {
   let create_type1_cql = "CREATE TYPE IF NOT EXISTS cdrs_test.nested_inner_udt (my_text text)";
   let create_type2_cql = "CREATE TYPE IF NOT EXISTS cdrs_test.nested_outer_udt \
@@ -153,7 +173,7 @@ fn nested_udt() {
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn alter_udt_add() {
   let drop_table_cql = "DROP TABLE IF EXISTS cdrs_test.test_alter_udt_add";
   let drop_type_cql = "DROP TYPE IF EXISTS cdrs_test.alter_udt_add_udt";
diff --git a/tests/keyspace.rs b/tests/keyspace.rs
index d3b1ba5..8f52f12 100644
--- a/tests/keyspace.rs
+++ b/tests/keyspace.rs
@@ -1,185 +1,192 @@
 extern crate cdrs;
 
+#[cfg(feature = "e2e-tests")]
 use std::collections::HashMap;
 
+#[cfg(feature = "e2e-tests")]
 use cdrs::authenticators::NoneAuthenticator;
+#[cfg(feature = "e2e-tests")]
 use cdrs::cluster::session::{new as new_session, Session};
+#[cfg(feature = "e2e-tests")]
 use cdrs::cluster::{ClusterTcpConfig, NodeTcpConfigBuilder, TcpConnectionPool};
+#[cfg(feature = "e2e-tests")]
 use cdrs::load_balancing::RoundRobin;
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::map::Map;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::{AsRust, ByName, IntoRustByName};
-
+#[cfg(feature = "e2e-tests")]
+#[cfg(feature = "e2e-tests")]
 const ADDR: &'static str = "127.0.0.1:9042";
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn create_keyspace() {
-        let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
-        let cluster_config = ClusterTcpConfig(vec![node]);
-        let lb = RoundRobin::new();
-        let session = new_session(&cluster_config, lb).expect("session should be created");
-
-        let drop_query = "DROP KEYSPACE IF EXISTS create_ks_test";
-        let keyspace_droped = session.query(drop_query).is_ok();
-        assert!(keyspace_droped, "Should drop new keyspace without errors");
-
-        let create_query = "CREATE KEYSPACE IF NOT EXISTS create_ks_test WITH \
-                            replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
-                            AND durable_writes = false";
-        let keyspace_created = session.query(create_query).is_ok();
-        assert!(
-                keyspace_created,
-                "Should create new keyspace without errors"
-        );
-
-        let select_query =
-                "SELECT * FROM system_schema.keyspaces WHERE keyspace_name = 'create_ks_test'";
-        let keyspace_selected = session
-                .query(select_query)
-                .expect("select keyspace query")
-                .get_body()
-                .expect("get select keyspace query body")
-                .into_rows()
-                .expect("convert keyspaces results into rows");
-
-        assert_eq!(keyspace_selected.len(), 1);
-        let keyspace = &keyspace_selected[0];
-
-        let keyspace_name: String = keyspace
-                .get_r_by_name("keyspace_name")
-                .expect("keyspace name into rust error");
-        assert_eq!(
-                keyspace_name,
-                "create_ks_test".to_string(),
-                "wrong keyspace name"
-        );
-
-        let durable_writes: bool = keyspace
-                .get_r_by_name("durable_writes")
-                .expect("durable writes into rust error");
-        assert_eq!(durable_writes, false, "wrong durable writes");
-
-        let mut expected_strategy_options: HashMap<String, String> = HashMap::new();
-        expected_strategy_options.insert("replication_factor".to_string(), "1".to_string());
-        expected_strategy_options.insert(
-                "class".to_string(),
-                "org.apache.cassandra.locator.SimpleStrategy".to_string(),
-        );
-        let strategy_options: HashMap<String, String> = keyspace
-                .r_by_name::<Map>("replication")
-                .expect("strategy optioins into rust error")
-                .as_r_rust()
-                .expect("uuid_key_map");
-        assert_eq!(
-                expected_strategy_options, strategy_options,
-                "wrong strategy options"
-        );
+  let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
+  let cluster_config = ClusterTcpConfig(vec![node]);
+  let lb = RoundRobin::new();
+  let session = new_session(&cluster_config, lb).expect("session should be created");
+
+  let drop_query = "DROP KEYSPACE IF EXISTS create_ks_test";
+  let keyspace_droped = session.query(drop_query).is_ok();
+  assert!(keyspace_droped, "Should drop new keyspace without errors");
+
+  let create_query = "CREATE KEYSPACE IF NOT EXISTS create_ks_test WITH \
+                      replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
+                      AND durable_writes = false";
+  let keyspace_created = session.query(create_query).is_ok();
+  assert!(
+    keyspace_created,
+    "Should create new keyspace without errors"
+  );
+
+  let select_query = "SELECT * FROM system_schema.keyspaces WHERE keyspace_name = 'create_ks_test'";
+  let keyspace_selected = session
+    .query(select_query)
+    .expect("select keyspace query")
+    .get_body()
+    .expect("get select keyspace query body")
+    .into_rows()
+    .expect("convert keyspaces results into rows");
+
+  assert_eq!(keyspace_selected.len(), 1);
+  let keyspace = &keyspace_selected[0];
+
+  let keyspace_name: String = keyspace
+    .get_r_by_name("keyspace_name")
+    .expect("keyspace name into rust error");
+  assert_eq!(
+    keyspace_name,
+    "create_ks_test".to_string(),
+    "wrong keyspace name"
+  );
+
+  let durable_writes: bool = keyspace
+    .get_r_by_name("durable_writes")
+    .expect("durable writes into rust error");
+  assert_eq!(durable_writes, false, "wrong durable writes");
+
+  let mut expected_strategy_options: HashMap<String, String> = HashMap::new();
+  expected_strategy_options.insert("replication_factor".to_string(), "1".to_string());
+  expected_strategy_options.insert(
+    "class".to_string(),
+    "org.apache.cassandra.locator.SimpleStrategy".to_string(),
+  );
+  let strategy_options: HashMap<String, String> = keyspace
+    .r_by_name::<Map>("replication")
+    .expect("strategy optioins into rust error")
+    .as_r_rust()
+    .expect("uuid_key_map");
+  assert_eq!(
+    expected_strategy_options, strategy_options,
+    "wrong strategy options"
+  );
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn alter_keyspace() {
-        let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
-        let cluster_config = ClusterTcpConfig(vec![node]);
-        let lb = RoundRobin::new();
-        let session = new_session(&cluster_config, lb).expect("session should be created");
-
-        let drop_query = "DROP KEYSPACE IF EXISTS alter_ks_test";
-        let keyspace_droped = session.query(drop_query).is_ok();
-        assert!(keyspace_droped, "Should drop new keyspace without errors");
-
-        let create_query = "CREATE KEYSPACE IF NOT EXISTS alter_ks_test WITH \
-                            replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
-                            AND durable_writes = false";
-        let keyspace_created = session.query(create_query).is_ok();
-        assert!(
-                keyspace_created,
-                "Should create new keyspace without errors"
-        );
-
-        let alter_query = "ALTER KEYSPACE alter_ks_test WITH \
-                           replication = {'class': 'SimpleStrategy', 'replication_factor': 3} \
-                           AND durable_writes = false";
-        assert!(
-                session.query(alter_query).is_ok(),
-                "alter should be without errors"
-        );
-
-        let select_query =
-                "SELECT * FROM system_schema.keyspaces WHERE keyspace_name = 'alter_ks_test'";
-        let keyspace_selected = session
-                .query(select_query)
-                .expect("select keyspace query")
-                .get_body()
-                .expect("get select keyspace query body")
-                .into_rows()
-                .expect("convert keyspaces results into rows");
-
-        assert_eq!(keyspace_selected.len(), 1);
-        let keyspace = &keyspace_selected[0];
-
-        let strategy_options: HashMap<String, String> = keyspace
-                .r_by_name::<Map>("replication")
-                .expect("strategy optioins into rust error")
-                .as_r_rust()
-                .expect("uuid_key_map");
-
-        assert_eq!(
-                strategy_options
-                        .get("replication_factor")
-                        .expect("replication_factor unwrap"),
-                &"3".to_string()
-        );
+  let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
+  let cluster_config = ClusterTcpConfig(vec![node]);
+  let lb = RoundRobin::new();
+  let session = new_session(&cluster_config, lb).expect("session should be created");
+
+  let drop_query = "DROP KEYSPACE IF EXISTS alter_ks_test";
+  let keyspace_droped = session.query(drop_query).is_ok();
+  assert!(keyspace_droped, "Should drop new keyspace without errors");
+
+  let create_query = "CREATE KEYSPACE IF NOT EXISTS alter_ks_test WITH \
+                      replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
+                      AND durable_writes = false";
+  let keyspace_created = session.query(create_query).is_ok();
+  assert!(
+    keyspace_created,
+    "Should create new keyspace without errors"
+  );
+
+  let alter_query = "ALTER KEYSPACE alter_ks_test WITH \
+                     replication = {'class': 'SimpleStrategy', 'replication_factor': 3} \
+                     AND durable_writes = false";
+  assert!(
+    session.query(alter_query).is_ok(),
+    "alter should be without errors"
+  );
+
+  let select_query = "SELECT * FROM system_schema.keyspaces WHERE keyspace_name = 'alter_ks_test'";
+  let keyspace_selected = session
+    .query(select_query)
+    .expect("select keyspace query")
+    .get_body()
+    .expect("get select keyspace query body")
+    .into_rows()
+    .expect("convert keyspaces results into rows");
+
+  assert_eq!(keyspace_selected.len(), 1);
+  let keyspace = &keyspace_selected[0];
+
+  let strategy_options: HashMap<String, String> = keyspace
+    .r_by_name::<Map>("replication")
+    .expect("strategy optioins into rust error")
+    .as_r_rust()
+    .expect("uuid_key_map");
+
+  assert_eq!(
+    strategy_options
+      .get("replication_factor")
+      .expect("replication_factor unwrap"),
+    &"3".to_string()
+  );
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn use_keyspace() {
-        let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
-        let cluster_config = ClusterTcpConfig(vec![node]);
-        let lb = RoundRobin::new();
-        let session = new_session(&cluster_config, lb).expect("session should be created");
-
-        let create_query = "CREATE KEYSPACE IF NOT EXISTS use_ks_test WITH \
-                            replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
-                            AND durable_writes = false";
-        let keyspace_created = session.query(create_query).is_ok();
-        assert!(
-                keyspace_created,
-                "Should create new keyspace without errors"
-        );
-
-        let use_query = "USE use_ks_test";
-        let keyspace_used = session
-                .query(use_query)
-                .expect("should use selected")
-                .get_body()
-                .expect("should get body")
-                .into_set_keyspace()
-                .expect("set keyspace")
-                .body;
-        assert_eq!(keyspace_used.as_str(), "use_ks_test", "wrong kespace used");
+  let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
+  let cluster_config = ClusterTcpConfig(vec![node]);
+  let lb = RoundRobin::new();
+  let session = new_session(&cluster_config, lb).expect("session should be created");
+
+  let create_query = "CREATE KEYSPACE IF NOT EXISTS use_ks_test WITH \
+                      replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
+                      AND durable_writes = false";
+  let keyspace_created = session.query(create_query).is_ok();
+  assert!(
+    keyspace_created,
+    "Should create new keyspace without errors"
+  );
+
+  let use_query = "USE use_ks_test";
+  let keyspace_used = session
+    .query(use_query)
+    .expect("should use selected")
+    .get_body()
+    .expect("should get body")
+    .into_set_keyspace()
+    .expect("set keyspace")
+    .body;
+  assert_eq!(keyspace_used.as_str(), "use_ks_test", "wrong kespace used");
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn drop_keyspace() {
-        let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
-        let cluster_config = ClusterTcpConfig(vec![node]);
-        let lb = RoundRobin::new();
-        let session = new_session(&cluster_config, lb).expect("session should be created");
-
-        let create_query = "CREATE KEYSPACE IF NOT EXISTS drop_ks_test WITH \
-                            replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
-                            AND durable_writes = false";
-        let keyspace_created = session.query(create_query).is_ok();
-        assert!(
-                keyspace_created,
-                "Should create new keyspace without errors"
-        );
-
-        let drop_query = "DROP KEYSPACE drop_ks_test";
-        let keyspace_droped = session.query(drop_query).is_ok();
-        assert!(keyspace_droped, "Should drop new keyspace without errors");
+  let node = NodeTcpConfigBuilder::new("127.0.0.1:9042", NoneAuthenticator {}).build();
+  let cluster_config = ClusterTcpConfig(vec![node]);
+  let lb = RoundRobin::new();
+  let session = new_session(&cluster_config, lb).expect("session should be created");
+
+  let create_query = "CREATE KEYSPACE IF NOT EXISTS drop_ks_test WITH \
+                      replication = {'class': 'SimpleStrategy', 'replication_factor': 1} \
+                      AND durable_writes = false";
+  let keyspace_created = session.query(create_query).is_ok();
+  assert!(
+    keyspace_created,
+    "Should create new keyspace without errors"
+  );
+
+  let drop_query = "DROP KEYSPACE drop_ks_test";
+  let keyspace_droped = session.query(drop_query).is_ok();
+  assert!(keyspace_droped, "Should drop new keyspace without errors");
 }
diff --git a/tests/native_types.rs b/tests/native_types.rs
index 58b9653..7c116b6 100644
--- a/tests/native_types.rs
+++ b/tests/native_types.rs
@@ -1,3 +1,4 @@
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate cdrs;
 extern crate regex;
@@ -6,375 +7,385 @@ extern crate uuid;
 
 mod common;
 
+#[cfg(feature = "e2e-tests")]
 use common::*;
 
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::blob::Blob;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::decimal::Decimal;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::map::Map;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::value::Bytes;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::{AsRust, ByName, IntoRustByName};
+#[cfg(feature = "e2e-tests")]
 use uuid::Uuid;
 
+#[cfg(feature = "e2e-tests")]
 use std::collections::HashMap;
+#[cfg(feature = "e2e-tests")]
 use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
+#[cfg(feature = "e2e-tests")]
 use std::str::FromStr;
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn string() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_string \
-               (my_ascii ascii PRIMARY KEY, my_text text, my_varchar varchar)";
-    let session = setup(cql).expect("setup");
-
-    let my_ascii = "my_ascii";
-    let my_text = "my_text";
-    let my_varchar = "my_varchar";
-    let values = query_values!(my_ascii, my_text, my_varchar);
-
-    let query = "INSERT INTO cdrs_test.test_string \
-                 (my_ascii, my_text, my_varchar) VALUES (?, ?, ?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert stings error");
-
-    let cql = "SELECT * FROM cdrs_test.test_string";
-    let rows = session
-        .query(cql)
-        .expect("select strings query error")
-        .get_body()
-        .expect("get body error")
-        .into_rows()
-        .expect("converting into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_ascii_row: String = row.get_r_by_name("my_ascii").expect("my_ascii");
-        let my_text_row: String = row.get_r_by_name("my_text").expect("my_text");
-        let my_varchar_row: String = row.get_r_by_name("my_varchar").expect("my_varchar");
-        assert_eq!(my_ascii_row, my_ascii);
-        assert_eq!(my_text_row, my_text);
-        assert_eq!(my_varchar_row, my_varchar);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_string \
+             (my_ascii ascii PRIMARY KEY, my_text text, my_varchar varchar)";
+  let session = setup(cql).expect("setup");
+
+  let my_ascii = "my_ascii";
+  let my_text = "my_text";
+  let my_varchar = "my_varchar";
+  let values = query_values!(my_ascii, my_text, my_varchar);
+
+  let query = "INSERT INTO cdrs_test.test_string \
+               (my_ascii, my_text, my_varchar) VALUES (?, ?, ?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert stings error");
+
+  let cql = "SELECT * FROM cdrs_test.test_string";
+  let rows = session
+    .query(cql)
+    .expect("select strings query error")
+    .get_body()
+    .expect("get body error")
+    .into_rows()
+    .expect("converting into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_ascii_row: String = row.get_r_by_name("my_ascii").expect("my_ascii");
+    let my_text_row: String = row.get_r_by_name("my_text").expect("my_text");
+    let my_varchar_row: String = row.get_r_by_name("my_varchar").expect("my_varchar");
+    assert_eq!(my_ascii_row, my_ascii);
+    assert_eq!(my_text_row, my_text);
+    assert_eq!(my_varchar_row, my_varchar);
+  }
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn counter() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_counter \
-               (my_bigint bigint PRIMARY KEY, my_counter counter)";
-    let session = setup(cql).expect("setup");
-
-    let my_bigint: i64 = 10_000_000_000_000_000;
-    let my_counter: i64 = 100_000_000;
-    let values = query_values!(my_counter, my_bigint);
-
-    let query = "UPDATE cdrs_test.test_counter SET my_counter = my_counter + ? \
-                 WHERE my_bigint = ?";
-    session.query_with_values(query, values).expect("insert");
-
-    let cql = "SELECT * FROM cdrs_test.test_counter";
-    let rows = session
-        .query(cql)
-        .expect("select counter query error")
-        .get_body()
-        .expect("get counter body error")
-        .into_rows()
-        .expect("converting coutner body into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_bigint_row: i64 = row.get_r_by_name("my_bigint").expect("my_bigint");
-        let my_counter_row: i64 = row.get_r_by_name("my_counter").expect("my_counter");
-        assert_eq!(my_bigint_row, my_bigint);
-        assert_eq!(my_counter_row, my_counter);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_counter \
+             (my_bigint bigint PRIMARY KEY, my_counter counter)";
+  let session = setup(cql).expect("setup");
+
+  let my_bigint: i64 = 10_000_000_000_000_000;
+  let my_counter: i64 = 100_000_000;
+  let values = query_values!(my_counter, my_bigint);
+
+  let query = "UPDATE cdrs_test.test_counter SET my_counter = my_counter + ? \
+               WHERE my_bigint = ?";
+  session.query_with_values(query, values).expect("insert");
+
+  let cql = "SELECT * FROM cdrs_test.test_counter";
+  let rows = session
+    .query(cql)
+    .expect("select counter query error")
+    .get_body()
+    .expect("get counter body error")
+    .into_rows()
+    .expect("converting coutner body into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_bigint_row: i64 = row.get_r_by_name("my_bigint").expect("my_bigint");
+    let my_counter_row: i64 = row.get_r_by_name("my_counter").expect("my_counter");
+    assert_eq!(my_bigint_row, my_bigint);
+    assert_eq!(my_counter_row, my_counter);
+  }
 }
 
 // TODO varint
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn integer() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_integer \
-               (my_bigint bigint PRIMARY KEY, my_int int, my_boolean boolean)";
-    let session = setup(cql).expect("setup");
-
-    let my_bigint: i64 = 10_000_000_000_000_000;
-    let my_int: i32 = 100_000_000;
-    let my_boolean: bool = true;
-    let values = query_values!(my_bigint, my_int, my_boolean);
-
-    let query = "INSERT INTO cdrs_test.test_integer \
-                 (my_bigint, my_int, my_boolean) VALUES (?, ?, ?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert integers error");
-
-    let cql = "SELECT * FROM cdrs_test.test_integer";
-    let rows = session
-        .query(cql)
-        .expect("select integers query error")
-        .get_body()
-        .expect("get body with integers error")
-        .into_rows()
-        .expect("converting body with integers into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_bigint_row: i64 = row.get_r_by_name("my_bigint").expect("my_bigint");
-        let my_int_row: i32 = row.get_r_by_name("my_int").expect("my_int");
-        let my_boolean_row: bool = row.get_r_by_name("my_boolean").expect("my_boolean");
-        assert_eq!(my_bigint_row, my_bigint);
-        assert_eq!(my_int_row, my_int);
-        assert_eq!(my_boolean_row, my_boolean);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_integer \
+             (my_bigint bigint PRIMARY KEY, my_int int, my_boolean boolean)";
+  let session = setup(cql).expect("setup");
+
+  let my_bigint: i64 = 10_000_000_000_000_000;
+  let my_int: i32 = 100_000_000;
+  let my_boolean: bool = true;
+  let values = query_values!(my_bigint, my_int, my_boolean);
+
+  let query = "INSERT INTO cdrs_test.test_integer \
+               (my_bigint, my_int, my_boolean) VALUES (?, ?, ?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert integers error");
+
+  let cql = "SELECT * FROM cdrs_test.test_integer";
+  let rows = session
+    .query(cql)
+    .expect("select integers query error")
+    .get_body()
+    .expect("get body with integers error")
+    .into_rows()
+    .expect("converting body with integers into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_bigint_row: i64 = row.get_r_by_name("my_bigint").expect("my_bigint");
+    let my_int_row: i32 = row.get_r_by_name("my_int").expect("my_int");
+    let my_boolean_row: bool = row.get_r_by_name("my_boolean").expect("my_boolean");
+    assert_eq!(my_bigint_row, my_bigint);
+    assert_eq!(my_int_row, my_int);
+    assert_eq!(my_boolean_row, my_boolean);
+  }
 }
 
 // TODO counter, varint
 #[test]
-#[ignore]
-#[cfg(feature = "v4")]
+#[cfg(all(feature = "v4", feature = "e2e-tests"))]
 fn integer_v4() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_integer_v4 \
-               (my_bigint bigint PRIMARY KEY, my_int int, my_smallint smallint, \
-               my_tinyint tinyint, my_boolean boolean)";
-    let session = setup(cql).expect("setup");
-
-    let my_bigint: i64 = 10_000_000_000_000_000;
-    let my_int: i32 = 100_000_000;
-    let my_smallint: i16 = 10_000;
-    let my_tinyint: i8 = 100;
-    let my_boolean: bool = true;
-    let values = query_values!(my_bigint, my_int, my_smallint, my_tinyint, my_boolean);
-
-    let query = "INSERT INTO cdrs_test.test_integer_v4 \
-                 (my_bigint, my_int, my_smallint, my_tinyint, my_boolean) VALUES (?, ?, ?, ?, ?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert integers error");
-
-    let cql = "SELECT * FROM cdrs_test.test_integer_v4";
-    let rows = session
-        .query(cql)
-        .expect("query integers error")
-        .get_body()
-        .expect("get body with integers error")
-        .into_rows()
-        .expect("converting body with integers into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_bigint_row: i64 = row.get_r_by_name("my_bigint").expect("my_bigint");
-        let my_int_row: i32 = row.get_r_by_name("my_int").expect("my_int");
-        let my_smallint_row: i16 = row.get_r_by_name("my_smallint").expect("my_smallint");
-        let my_tinyint_row: i8 = row.get_r_by_name("my_tinyint").expect("my_tinyint");
-        let my_boolean_row: bool = row.get_r_by_name("my_boolean").expect("my_boolean");
-        assert_eq!(my_bigint_row, my_bigint);
-        assert_eq!(my_int_row, my_int);
-        assert_eq!(my_smallint_row, my_smallint);
-        assert_eq!(my_tinyint_row, my_tinyint);
-        assert_eq!(my_boolean_row, my_boolean);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_integer_v4 \
+             (my_bigint bigint PRIMARY KEY, my_int int, my_smallint smallint, \
+             my_tinyint tinyint, my_boolean boolean)";
+  let session = setup(cql).expect("setup");
+
+  let my_bigint: i64 = 10_000_000_000_000_000;
+  let my_int: i32 = 100_000_000;
+  let my_smallint: i16 = 10_000;
+  let my_tinyint: i8 = 100;
+  let my_boolean: bool = true;
+  let values = query_values!(my_bigint, my_int, my_smallint, my_tinyint, my_boolean);
+
+  let query = "INSERT INTO cdrs_test.test_integer_v4 \
+               (my_bigint, my_int, my_smallint, my_tinyint, my_boolean) VALUES (?, ?, ?, ?, ?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert integers error");
+
+  let cql = "SELECT * FROM cdrs_test.test_integer_v4";
+  let rows = session
+    .query(cql)
+    .expect("query integers error")
+    .get_body()
+    .expect("get body with integers error")
+    .into_rows()
+    .expect("converting body with integers into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_bigint_row: i64 = row.get_r_by_name("my_bigint").expect("my_bigint");
+    let my_int_row: i32 = row.get_r_by_name("my_int").expect("my_int");
+    let my_smallint_row: i16 = row.get_r_by_name("my_smallint").expect("my_smallint");
+    let my_tinyint_row: i8 = row.get_r_by_name("my_tinyint").expect("my_tinyint");
+    let my_boolean_row: bool = row.get_r_by_name("my_boolean").expect("my_boolean");
+    assert_eq!(my_bigint_row, my_bigint);
+    assert_eq!(my_int_row, my_int);
+    assert_eq!(my_smallint_row, my_smallint);
+    assert_eq!(my_tinyint_row, my_tinyint);
+    assert_eq!(my_boolean_row, my_boolean);
+  }
 }
 
 // TODO decimal
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn float() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_float \
-               (my_float float PRIMARY KEY, my_double double, my_decimal_a decimal, my_decimal_b decimal)";
-    let session = setup(cql).expect("setup");
-
-    let my_float: f32 = 123.456;
-    let my_double: f64 = 987.654;
-    let my_decimal_b = std::i64::MAX;
-    let values = query_values!(
-        my_float,
-        my_double,
-        Decimal::new(12001, 2),
-        Decimal::from(my_decimal_b)
-    );
-
-    let query =
+  let cql =
+    "CREATE TABLE IF NOT EXISTS cdrs_test.test_float \
+     (my_float float PRIMARY KEY, my_double double, my_decimal_a decimal, my_decimal_b decimal)";
+  let session = setup(cql).expect("setup");
+
+  let my_float: f32 = 123.456;
+  let my_double: f64 = 987.654;
+  let my_decimal_b = std::i64::MAX;
+  let values = query_values!(
+    my_float,
+    my_double,
+    Decimal::new(12001, 2),
+    Decimal::from(my_decimal_b)
+  );
+
+  let query =
         "INSERT INTO cdrs_test.test_float (my_float, my_double, my_decimal_a, my_decimal_b) VALUES (?, ?, ?, ?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert floats error");
-
-    let cql = "SELECT * FROM cdrs_test.test_float";
-    let rows = session
-        .query(cql)
-        .expect("query floats error")
-        .get_body()
-        .expect("get body with floats error")
-        .into_rows()
-        .expect("converting body with floats into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_float_row: f32 = row.get_r_by_name("my_float").expect("my_float");
-        let my_double_row: f64 = row.get_r_by_name("my_double").expect("my_double");
-        let my_decimal_row_a: Decimal = row.get_r_by_name("my_decimal_a").expect("my_decimal_a");
-        let my_decimal_row_b: Decimal = row.get_r_by_name("my_decimal_b").expect("my_decimal_b");
-        assert_eq!(my_float_row, my_float);
-        assert_eq!(my_double_row, my_double);
-        assert_eq!(my_decimal_row_a, Decimal::new(12001, 2));
-        assert_eq!(my_decimal_row_b, Decimal::from(my_decimal_b));
-    }
+  session
+    .query_with_values(query, values)
+    .expect("insert floats error");
+
+  let cql = "SELECT * FROM cdrs_test.test_float";
+  let rows = session
+    .query(cql)
+    .expect("query floats error")
+    .get_body()
+    .expect("get body with floats error")
+    .into_rows()
+    .expect("converting body with floats into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_float_row: f32 = row.get_r_by_name("my_float").expect("my_float");
+    let my_double_row: f64 = row.get_r_by_name("my_double").expect("my_double");
+    let my_decimal_row_a: Decimal = row.get_r_by_name("my_decimal_a").expect("my_decimal_a");
+    let my_decimal_row_b: Decimal = row.get_r_by_name("my_decimal_b").expect("my_decimal_b");
+    assert_eq!(my_float_row, my_float);
+    assert_eq!(my_double_row, my_double);
+    assert_eq!(my_decimal_row_a, Decimal::new(12001, 2));
+    assert_eq!(my_decimal_row_b, Decimal::from(my_decimal_b));
+  }
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn blob() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_blob \
-               (my_blob blob PRIMARY KEY, my_mapblob map<text, blob>)";
-    let session = setup(cql).expect("setup");
-
-    let my_blob: Blob = vec![0, 1, 2, 4, 8, 16, 32, 64, 128, 255].into();
-    let my_map: HashMap<String, Blob> = [
-        ("a".to_owned(), b"aaaaa".to_vec().into()),
-        ("b".to_owned(), b"bbbbb".to_vec().into()),
-        ("c".to_owned(), b"ccccc".to_vec().into()),
-        ("d".to_owned(), b"ddddd".to_vec().into()),
-    ]
-        .into_iter()
-        .map(|x| x.clone())
-        .collect();
-
-    let val_map: HashMap<String, Bytes> = my_map
-        .clone()
-        .into_iter()
-        .map(|(k, v)| (k, Bytes::new(v.into_vec())))
-        .collect();
-
-    let values = query_values!(my_blob.clone(), val_map);
-
-    let query = "INSERT INTO cdrs_test.test_blob (my_blob, my_mapblob) VALUES (?,?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert blob error");
-
-    let cql = "SELECT * FROM cdrs_test.test_blob";
-    let rows = session
-        .query(cql)
-        .expect("query blobs error")
-        .get_body()
-        .expect("get body with blobs error")
-        .into_rows()
-        .expect("converting body with blobs into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_blob_row: Blob = row.get_r_by_name("my_blob").expect("my_blob");
-        assert_eq!(my_blob_row, my_blob);
-        let my_map_row: HashMap<String, Blob> = row
-            .r_by_name::<Map>("my_mapblob")
-            .expect("my_mapblob by name")
-            .as_r_rust()
-            .expect("my_mapblob as r rust");
-        assert_eq!(my_map_row, my_map);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_blob \
+             (my_blob blob PRIMARY KEY, my_mapblob map<text, blob>)";
+  let session = setup(cql).expect("setup");
+
+  let my_blob: Blob = vec![0, 1, 2, 4, 8, 16, 32, 64, 128, 255].into();
+  let my_map: HashMap<String, Blob> = [
+    ("a".to_owned(), b"aaaaa".to_vec().into()),
+    ("b".to_owned(), b"bbbbb".to_vec().into()),
+    ("c".to_owned(), b"ccccc".to_vec().into()),
+    ("d".to_owned(), b"ddddd".to_vec().into()),
+  ]
+  .into_iter()
+  .map(|x| x.clone())
+  .collect();
+
+  let val_map: HashMap<String, Bytes> = my_map
+    .clone()
+    .into_iter()
+    .map(|(k, v)| (k, Bytes::new(v.into_vec())))
+    .collect();
+
+  let values = query_values!(my_blob.clone(), val_map);
+
+  let query = "INSERT INTO cdrs_test.test_blob (my_blob, my_mapblob) VALUES (?,?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert blob error");
+
+  let cql = "SELECT * FROM cdrs_test.test_blob";
+  let rows = session
+    .query(cql)
+    .expect("query blobs error")
+    .get_body()
+    .expect("get body with blobs error")
+    .into_rows()
+    .expect("converting body with blobs into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_blob_row: Blob = row.get_r_by_name("my_blob").expect("my_blob");
+    assert_eq!(my_blob_row, my_blob);
+    let my_map_row: HashMap<String, Blob> = row
+      .r_by_name::<Map>("my_mapblob")
+      .expect("my_mapblob by name")
+      .as_r_rust()
+      .expect("my_mapblob as r rust");
+    assert_eq!(my_map_row, my_map);
+  }
 }
 
 // TODO timeuuid
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn uuid() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_uuid \
-               (my_uuid uuid PRIMARY KEY)";
-    let session = setup(cql).expect("setup");
-
-    let my_uuid = Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap();
-    let values = query_values!(my_uuid);
-
-    let query = "INSERT INTO cdrs_test.test_uuid (my_uuid) VALUES (?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert UUID error");
-
-    let cql = "SELECT * FROM cdrs_test.test_uuid";
-    let rows = session
-        .query(cql)
-        .expect("query UUID error")
-        .get_body()
-        .expect("get body with UUID error")
-        .into_rows()
-        .expect("convertion body with UUID into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_uuid_row: Uuid = row.get_r_by_name("my_uuid").expect("my_uuid");
-        assert_eq!(my_uuid_row, my_uuid);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_uuid \
+             (my_uuid uuid PRIMARY KEY)";
+  let session = setup(cql).expect("setup");
+
+  let my_uuid = Uuid::from_str("bb16106a-10bc-4a07-baa3-126ffe208c43").unwrap();
+  let values = query_values!(my_uuid);
+
+  let query = "INSERT INTO cdrs_test.test_uuid (my_uuid) VALUES (?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert UUID error");
+
+  let cql = "SELECT * FROM cdrs_test.test_uuid";
+  let rows = session
+    .query(cql)
+    .expect("query UUID error")
+    .get_body()
+    .expect("get body with UUID error")
+    .into_rows()
+    .expect("convertion body with UUID into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_uuid_row: Uuid = row.get_r_by_name("my_uuid").expect("my_uuid");
+    assert_eq!(my_uuid_row, my_uuid);
+  }
 }
 
 // TODO date, time, duration
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn time() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_time \
-               (my_timestamp timestamp PRIMARY KEY)";
-    let session = setup(cql).expect("setup");
-
-    let my_timestamp = time::get_time();
-    let values = query_values!(my_timestamp);
-
-    let query = "INSERT INTO cdrs_test.test_time (my_timestamp) VALUES (?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert timestamp error");
-
-    let cql = "SELECT * FROM cdrs_test.test_time";
-    let rows = session
-        .query(cql)
-        .expect("query with time error")
-        .get_body()
-        .expect("get body with time error")
-        .into_rows()
-        .expect("converting body with time into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_timestamp_row: time::Timespec =
-            row.get_r_by_name("my_timestamp").expect("my_timestamp");
-        assert_eq!(my_timestamp_row.sec, my_timestamp.sec);
-        assert_eq!(
-            my_timestamp_row.nsec / 1_000_000,
-            my_timestamp.nsec / 1_000_000
-        ); // C* `timestamp` has millisecond precision
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_time \
+             (my_timestamp timestamp PRIMARY KEY)";
+  let session = setup(cql).expect("setup");
+
+  let my_timestamp = time::get_time();
+  let values = query_values!(my_timestamp);
+
+  let query = "INSERT INTO cdrs_test.test_time (my_timestamp) VALUES (?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert timestamp error");
+
+  let cql = "SELECT * FROM cdrs_test.test_time";
+  let rows = session
+    .query(cql)
+    .expect("query with time error")
+    .get_body()
+    .expect("get body with time error")
+    .into_rows()
+    .expect("converting body with time into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_timestamp_row: time::Timespec = row.get_r_by_name("my_timestamp").expect("my_timestamp");
+    assert_eq!(my_timestamp_row.sec, my_timestamp.sec);
+    assert_eq!(
+      my_timestamp_row.nsec / 1_000_000,
+      my_timestamp.nsec / 1_000_000
+    ); // C* `timestamp` has millisecond precision
+  }
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn inet() {
-    let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_inet \
-               (my_inet_v4 inet PRIMARY KEY, my_inet_v6 inet)";
-    let session = setup(cql).expect("setup");
-
-    let my_inet_v4 = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
-    let my_inet_v6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
-    let values = query_values!(my_inet_v4.clone(), my_inet_v6.clone());
-
-    let query = "INSERT INTO cdrs_test.test_inet (my_inet_v4, my_inet_v6) VALUES (?, ?)";
-    session
-        .query_with_values(query, values)
-        .expect("insert inet error");
-
-    let query = "SELECT * FROM cdrs_test.test_inet";
-    let rows = session
-        .query(query)
-        .expect("query inet error")
-        .get_body()
-        .expect("get body with inet error")
-        .into_rows()
-        .expect("converting body with inet into rows error");
-
-    assert_eq!(rows.len(), 1);
-    for row in rows {
-        let my_inet_v4_row: IpAddr = row.get_r_by_name("my_inet_v4").expect("my_inet_v4");
-        let my_inet_v6_row: IpAddr = row.get_r_by_name("my_inet_v6").expect("my_inet_v6");
-        assert_eq!(my_inet_v4_row, my_inet_v4);
-        assert_eq!(my_inet_v6_row, my_inet_v6);
-    }
+  let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_inet \
+             (my_inet_v4 inet PRIMARY KEY, my_inet_v6 inet)";
+  let session = setup(cql).expect("setup");
+
+  let my_inet_v4 = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
+  let my_inet_v6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
+  let values = query_values!(my_inet_v4.clone(), my_inet_v6.clone());
+
+  let query = "INSERT INTO cdrs_test.test_inet (my_inet_v4, my_inet_v6) VALUES (?, ?)";
+  session
+    .query_with_values(query, values)
+    .expect("insert inet error");
+
+  let query = "SELECT * FROM cdrs_test.test_inet";
+  let rows = session
+    .query(query)
+    .expect("query inet error")
+    .get_body()
+    .expect("get body with inet error")
+    .into_rows()
+    .expect("converting body with inet into rows error");
+
+  assert_eq!(rows.len(), 1);
+  for row in rows {
+    let my_inet_v4_row: IpAddr = row.get_r_by_name("my_inet_v4").expect("my_inet_v4");
+    let my_inet_v6_row: IpAddr = row.get_r_by_name("my_inet_v6").expect("my_inet_v6");
+    assert_eq!(my_inet_v4_row, my_inet_v4);
+    assert_eq!(my_inet_v6_row, my_inet_v6);
+  }
 }
diff --git a/tests/tuple_types.rs b/tests/tuple_types.rs
index 37454c6..3ceed36 100644
--- a/tests/tuple_types.rs
+++ b/tests/tuple_types.rs
@@ -1,3 +1,4 @@
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate cdrs;
 extern crate regex;
@@ -6,22 +7,33 @@ extern crate uuid;
 
 mod common;
 
+#[cfg(feature = "e2e-tests")]
 use common::*;
 
+#[cfg(feature = "e2e-tests")]
 use cdrs::error::Result;
+#[cfg(feature = "e2e-tests")]
 use cdrs::frame::IntoBytes;
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::blob::Blob;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::tuple::Tuple;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::value::{Bytes, Value};
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::{IntoRustByIndex, IntoRustByName};
+#[cfg(feature = "e2e-tests")]
 use time::Timespec;
+#[cfg(feature = "e2e-tests")]
 use uuid::Uuid;
 
+#[cfg(feature = "e2e-tests")]
 use std::str::FromStr;
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn simple_tuple() {
   let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.simple_tuple \
              (my_tuple tuple<text, int> PRIMARY KEY)";
@@ -83,7 +95,7 @@ fn simple_tuple() {
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn nested_tuples() {
   let cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_nested_tuples \
              (my_key int PRIMARY KEY, \
diff --git a/tests/user_defined_types.rs b/tests/user_defined_types.rs
index f7fc081..cc612b1 100644
--- a/tests/user_defined_types.rs
+++ b/tests/user_defined_types.rs
@@ -1,5 +1,7 @@
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate cdrs;
+#[cfg(feature = "e2e-tests")]
 #[macro_use]
 extern crate maplit;
 extern crate regex;
@@ -8,21 +10,31 @@ extern crate uuid;
 
 mod common;
 
+#[cfg(feature = "e2e-tests")]
 use common::*;
 
+#[cfg(feature = "e2e-tests")]
 use cdrs::error::Result;
+#[cfg(feature = "e2e-tests")]
 use cdrs::frame::IntoBytes;
+#[cfg(feature = "e2e-tests")]
 use cdrs::query::QueryExecutor;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::map::Map;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::udt::UDT;
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::value::{Bytes, Value};
+#[cfg(feature = "e2e-tests")]
 use cdrs::types::{AsRust, IntoRustByName};
+#[cfg(feature = "e2e-tests")]
 use time::Timespec;
 
+#[cfg(feature = "e2e-tests")]
 use std::collections::HashMap;
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn simple_udt() {
   let create_type_cql = "CREATE TYPE IF NOT EXISTS cdrs_test.simple_udt (my_text text)";
   let create_table_cql = "CREATE TABLE IF NOT EXISTS cdrs_test.test_simple_udt \
@@ -77,7 +89,7 @@ fn simple_udt() {
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn nested_udt() {
   let create_type1_cql = "CREATE TYPE IF NOT EXISTS cdrs_test.nested_inner_udt (my_text text)";
   let create_type2_cql = "CREATE TYPE IF NOT EXISTS cdrs_test.nested_outer_udt \
@@ -162,7 +174,7 @@ fn nested_udt() {
 }
 
 #[test]
-#[ignore]
+#[cfg(feature = "e2e-tests")]
 fn alter_udt_add() {
   let drop_table_cql = "DROP TABLE IF EXISTS cdrs_test.test_alter_udt_add";
   let drop_type_cql = "DROP TYPE IF EXISTS cdrs_test.alter_udt_add_udt";
@@ -174,7 +186,8 @@ fn alter_udt_add() {
     drop_type_cql,
     create_type_cql,
     create_table_cql,
-  ]).expect("setup");
+  ])
+  .expect("setup");
 
   #[derive(Debug, Clone, PartialEq)]
   struct MyUdtA {