pub fn as_i64(&self) -> crate::Result<i64> {
        match &self {
            Self::I32(v) => Ok(*v as i64),
            Self::U32(v) => Ok(*v as i64),
            Self::I64(v) => Ok(*v),
            Self::U64(v) => Ok(*v as i64),
            Self::F64(v) => Ok(*v as i64),
            Self::Bool(v) => Ok(*v as i64),
            Self::Str(v) => match v.parse::<i64>() {
                Ok(i) => Ok(i),
                Err(e) => Err(error::parse_value(e.into())),
            },
            _ => Err(error::unimplement("can not convert to i64"))
        }
    }
/// If Value can parse to i64, returns an i64. Returns Err otherwise.
If Value can parse to i64, returns an i64. Returns Err otherwise.
If Value can parse to i64 returns an i64 . Returns Err otherwise .
pub fn as_i64(&self) -> crate::Result<i64> {
        match &self {
            Self::I32(v) => Ok(*v as i64),
            Self::U32(v) => Ok(*v as i64),
            Self::I64(v) => Ok(*v),
            Self::U64(v) => Ok(*v as i64),
            Self::F64(v) => Ok(*v as i64),
            Self::Bool(v) => Ok(*v as i64),
            Self::Str(v) => match v.parse::<i64>() {
                Ok(i) => Ok(i),
                Err(e) => Err(error::parse_value(e.into())),
            },
            _ => Err(error::unimplement("can not convert to i64"))
        }
    }
pub fn as_i64 ( & self ) -> crate :: Result < i64 > { match & self { Self :: I32 ( v ) => Ok ( * v as i64 ) , Self :: U32 ( v ) => Ok ( * v as i64 ) , Self :: I64 ( v ) => Ok ( * v ) , Self :: U64 ( v ) => Ok ( * v as i64 ) , Self :: F64 ( v ) => Ok ( * v as i64 ) , Self :: Bool ( v ) => Ok ( * v as i64 ) , Self :: Str ( v ) => match v . parse :: < i64 > ( ) { Ok ( i ) => Ok ( i ) , Err ( e ) => Err ( error :: parse_value ( e . into ( ) ) ) , } , _ => Err ( error :: unimplement ( " " ) ) } }
If Value can parse to i64, returns an i64.
If Value can parse to i64 returns an i64 .
&self