Rename MaybeIncompleteDataError
...to BufferOverflowError
This commit is contained in:
parent
ba54f4cf57
commit
b073670732
10
src/lib.rs
10
src/lib.rs
@ -53,11 +53,11 @@ fn gen_session_id() -> u32 {
|
||||
/// The response may be incomplete, if the buffer has been filled up,
|
||||
/// because excess bytes that don't fit into it are discarded.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct MaybeIncompleteDataError(usize);
|
||||
pub struct BufferOverflowError(usize);
|
||||
|
||||
impl Error for MaybeIncompleteDataError {}
|
||||
impl Error for BufferOverflowError {}
|
||||
|
||||
impl Display for MaybeIncompleteDataError {
|
||||
impl Display for BufferOverflowError {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Buffer filled up")
|
||||
}
|
||||
@ -175,7 +175,7 @@ impl BasicQueryRequest {
|
||||
// Receiving
|
||||
let bytes_read = tokioTimeout(timeout, socket.recv(buffer)).await??;
|
||||
if bytes_read == buffer.len() {
|
||||
return Err(io::Error::new(ErrorKind::Other, MaybeIncompleteDataError(bytes_read)));
|
||||
return Err(io::Error::new(ErrorKind::Other, BufferOverflowError(bytes_read)));
|
||||
}
|
||||
|
||||
// Parsing
|
||||
@ -302,7 +302,7 @@ impl FullQueryRequest {
|
||||
// Receiving
|
||||
let bytes_read = tokioTimeout(timeout, socket.recv(buffer)).await??;
|
||||
if bytes_read == buffer.len() {
|
||||
return Err(io::Error::new(ErrorKind::Other, MaybeIncompleteDataError(bytes_read)));
|
||||
return Err(io::Error::new(ErrorKind::Other, BufferOverflowError(bytes_read)));
|
||||
}
|
||||
|
||||
// Parsing
|
||||
|
Loading…
Reference in New Issue
Block a user