pub fn to_int(&self) -> Option<i32> {
        match self {
            Value::Int(n) => Some(*n),
            Value::BigInt(n) => n.to_i32(),
            Value::Float(f) => Some(*f as i32),
            Value::String(s, _) => {
                let n_r = s.parse::<i32>();
                match n_r {
                    Ok(n) => {
                        return Some(n);
                    }
                    _ => {
                        return None;
                    }
                }
            }
            Value::Null => Some(0),
            _ => None,
        }
    }
/// Convert the current value into an i32.  If the value is not
/// representable as an i32, the result will be None.
Convert the current value into an i32.  If the value is not
representable as an i32, the result will be None.
Convert the current value into an i32 . If the value is not representable as an i32 the result will be None .
pub fn to_int(&self) -> Option<i32> {
        match self {
            Value::Int(n) => Some(*n),
            Value::BigInt(n) => n.to_i32(),
            Value::Float(f) => Some(*f as i32),
            Value::String(s, _) => {
                let n_r = s.parse::<i32>();
                match n_r {
                    Ok(n) => {
                        return Some(n);
                    }
                    _ => {
                        return None;
                    }
                }
            }
            Value::Null => Some(0),
            _ => None,
        }
    }
pub fn to_int ( & self ) -> Option < i32 > { match self { Value :: Int ( n ) => Some ( * n ) , Value :: BigInt ( n ) => n . to_i32 ( ) , Value :: Float ( f ) => Some ( * f as i32 ) , Value :: String ( s , _ ) => { let n_r = s . parse :: < i32 > ( ) ; match n_r { Ok ( n ) => { return Some ( n ) ; } _ => { return None ; } } } Value :: Null => Some ( 0 ) , _ => None , } }
Convert the current value into an i32.
Convert the current value into an i32 .
&self