@@ -385,10 +385,6 @@ impl Query {
385385 pub fn is_empty ( & self ) -> bool {
386386 self . size_count == 0
387387 }
388- /// Number of items in the datagroup
389- pub ( crate ) fn __len ( & self ) -> usize {
390- self . size_count
391- }
392388 fn get_holding_buffer ( & self ) -> & [ u8 ] {
393389 & self . data
394390 }
@@ -401,7 +397,7 @@ impl Query {
401397 // Write the metaframe
402398 stream. write_all( b"*1\n " ) . await ?;
403399 // Add the dataframe
404- let number_of_items_in_datagroup = self . __len ( ) . to_string( ) . into_bytes( ) ;
400+ let number_of_items_in_datagroup = self . len ( ) . to_string( ) . into_bytes( ) ;
405401 stream. write_all( & [ b'~' ] ) . await ?;
406402 stream. write_all( & number_of_items_in_datagroup) . await ?;
407403 stream. write_all( & [ b'\n' ] ) . await ?;
@@ -419,7 +415,7 @@ impl Query {
419415 // Write the metaframe
420416 stream. write_all( b"*1\n " ) ?;
421417 // Add the dataframe
422- let number_of_items_in_datagroup = self . __len ( ) . to_string( ) . into_bytes( ) ;
418+ let number_of_items_in_datagroup = self . len ( ) . to_string( ) . into_bytes( ) ;
423419 stream. write_all( & [ b'~' ] ) ?;
424420 stream. write_all( & number_of_items_in_datagroup) ?;
425421 stream. write_all( & [ b'\n' ] ) ?;
@@ -438,7 +434,7 @@ impl Query {
438434 pub fn into_raw_query( self ) -> Vec <u8 > {
439435 let mut v = Vec :: with_capacity( self . data. len( ) ) ;
440436 v. extend( b"*1\n ~" ) ;
441- v. extend( self . __len ( ) . to_string( ) . into_bytes( ) ) ;
437+ v. extend( self . len ( ) . to_string( ) . into_bytes( ) ) ;
442438 v. extend( b"\n " ) ;
443439 v. extend( self . get_holding_buffer( ) ) ;
444440 v
@@ -507,6 +503,8 @@ cfg_dbg!(
507503pub mod error {
508504 //! Errors
509505 cfg_ssl_any ! (
506+ use crate :: RespCode ;
507+ use std:: io:: ErrorKind ;
510508 use std:: fmt;
511509 /// Errors that may occur while initiating an [async TLS connection](crate::aio::TlsConnection)
512510 /// or a [sync TLS connection](crate::sync::TlsConnection)
@@ -549,12 +547,19 @@ pub mod error {
549547 #[ non_exhaustive]
550548 /// An error originating from the Skyhash protocol
551549 pub enum SkyhashError {
550+ /// The server sent data but we failed to parse it
551+ ParseError ,
552+ /// The server sent an unexpected data type for this action
553+ UnexpectedDataType ,
554+ /// The server sent an unknown data type that we cannot parse
555+ UnknownDataType ,
552556 /// The server sent an invalid response
553557 InvalidResponse ,
554- /// The server sent a response but it could not be parsed
555- ParseError ,
556- /// The server sent a data type not supported by this client version
557- UnsupportedDataType ,
558+ /// An I/O error occurred while running this action
559+ IoError ( ErrorKind ) ,
560+ /// The server returned a response code **other than the one that should have been returned
561+ /// for this action** (if any)
562+ Code ( RespCode ) ,
558563 }
559564
560565 #[ derive( Debug ) ]
0 commit comments