pub enum Error {
InvalidDateTime,
IO(Error),
InvalidCast {
from: &'static str,
to: &'static str,
},
InvalidCastList(&'static str),
IndexOutOfBounds {
length: usize,
index: usize,
},
InvalidOperation {
operator: &'static str,
operand_type: &'static str,
expected: Option<&'static str>,
},
LengthMismatch {
key_length: usize,
value_length: usize,
},
NoSuchColumn(String),
InsertWrongElement {
is_insert: bool,
destination: &'static str,
expected: &'static str,
},
PopFromEmptyList,
Object(K),
}Expand description
Error from network IO or invalid operation.
Variants§
InvalidDateTime
Invalid time was used to build Date or DateTime.
IO(Error)
Network error.
InvalidCast
Tried to cast to wrong type.
InvalidCastList(&'static str)
Tried to cast a list to wrong type.
IndexOutOfBounds
Tried to access an index which is out of range.
InvalidOperation
Invalid operation to a wrong type.
LengthMismatch
Length of dictionary key and value do not match.
NoSuchColumn(String)
Tried to get non-existing column.
InsertWrongElement
Tried to insert or push wrong element.
PopFromEmptyList
Tried to pop from empty list.
Object(K)
Tried to convert but coluld not.
Implementations§
Source§impl Error
impl Error
Sourcepub fn into_inner(self) -> Option<K>
pub fn into_inner(self) -> Option<K>
Comsume error and retrieve original object returned from some operation.
None is returned if the error does not contain K object.
use kdbplus::ipc::*;
let int = K::new_int(777);
match int.flip(){
Ok(_) => eprintln!("miracle!!"),
Err(original_) => {
let original = original_.into_inner().unwrap();
assert_eq!(original.get_int().unwrap(), 777);
}
}Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more