43
43
//! Now open up your `src/main.rs` file and establish a connection to the server while also adding some
44
44
//! imports:
45
45
//! ```no_run
46
- //! use skytable::{Connection, Query, Response, Element};
46
+ //! use skytable::{Connection, Query, Element};
47
47
//! fn main() -> std::io::Result<()> {
48
48
//! let mut con = Connection::new("127.0.0.1", 2003)?;
49
49
//! Ok(())
52
52
//!
53
53
//! Now let's run a [`Query`]! Change the previous code block to:
54
54
//! ```no_run
55
- //! use skytable::{error, Connection, Query, Response, Element};
55
+ //! use skytable::{error, Connection, Query, Element};
56
56
//! fn main() -> Result<(), error::Error> {
57
57
//! let mut con = Connection::new("127.0.0.1", 2003)?;
58
58
//! let query = Query::from("heya");
@@ -473,25 +473,6 @@ impl Query {
473
473
) ;
474
474
}
475
475
476
- /// # Responses
477
- ///
478
- /// This enum represents responses returned by the server. This can either be an array (or bulk), a single item
479
- /// or can be a parse error if the server returned some data but it couldn't be parsed into the expected type
480
- /// or it can be an invalid response in the event the server sent some invalid data.
481
- /// This enum is `#[non_exhaustive]` as more types of responses can be added in the future.
482
- #[ derive( Debug , PartialEq ) ]
483
- #[ non_exhaustive]
484
- pub enum Response {
485
- /// The server sent an invalid response
486
- InvalidResponse ,
487
- /// The server responded with _something_. This can be any of the [`Element`] variants
488
- Item ( Element ) ,
489
- /// We failed to parse data
490
- ParseError ,
491
- /// The server sent some data of a type that this client doesn't support
492
- UnsupportedDataType ,
493
- }
494
-
495
476
cfg_dbg ! (
496
477
#[ test]
497
478
fn my_query( ) {
@@ -505,9 +486,9 @@ cfg_dbg!(
505
486
506
487
pub mod error {
507
488
//! Errors
489
+ use crate :: RespCode ;
490
+ use std:: io:: ErrorKind ;
508
491
cfg_ssl_any ! (
509
- use crate :: RespCode ;
510
- use std:: io:: ErrorKind ;
511
492
use std:: fmt;
512
493
/// Errors that may occur while initiating an [async TLS connection](crate::aio::TlsConnection)
513
494
/// or a [sync TLS connection](crate::sync::TlsConnection)
0 commit comments