aerospike-client-rust
aerospike-client-rust copied to clipboard
Implement std::convert::TryFrom<aerospike::Value> for each variant
If the aerospike client implemented TryFrom, it would be much easier to unpack Values. It would be much easier to write this:
let field: i64 = value.try_into()?
Rather than this:
let field: i64 = match value {
Value::Int(v) => Ok(v),
_ => Err(CustomError::InvalidType)
}?;