Apologies, newbie here (thanks, edited formatting)
I'm querying some Mysql, which is working when I have a value with
use mysql::*;
use mysql::prelude::*;
..
let mut row = result_set.as_ref().unwrap();
let tag_string: <String> = row.get(4).unwrap();
Cargo.toml has mysql = "18.2.0"
, but I'm getting a panic when I try to cater for a Null sql value, so trying to use get_opt() instead.
Looking at the rust mysql docs here it seems to shows
pub fn get_opt<T, I>(&self, index: I) -> Option<Result<T, FromValueError>>
However, if I use
let tag_string: Option<Result<String>> = row.get_opt(4);
I get
expected enum `mysql::error::Error`, found struct `mysql_common::value::convert::FromValueError
If I try
let tag_string: Option<Result<String, FromValueError >> = row.get_opt(4);
I get
FromValueError: unexpected type argument
and
expected enum `mysql::error::Error`, found struct `mysql_common::value::convert::FromValueError
I've also tried giving it one mysql::error::Error or FromValueError only argument, but again I get
expected enum `mysql::error::Error`, found struct `mysql_common::value::convert::FromValueError
So I'm a bit confused about the error types and how to declare that type when it's only looking for one parameter ?