pub fn cmp(&self, ctx: &mut EvalContext, datum: &Datum) -> Result<Ordering> {
        if let Datum::Json(_) = *self {
            if let Datum::Json(_) = *datum {
            } else {
                // reverse compare when self is json while datum not.
                let order = datum.cmp(ctx, self)?;
                return Ok(order.reverse());
            }
        }

        match *datum {
            Datum::Null => match *self {
                Datum::Null => Ok(Ordering::Equal),
                _ => Ok(Ordering::Greater),
            },
            Datum::Min => match *self {
                Datum::Null => Ok(Ordering::Less),
                Datum::Min => Ok(Ordering::Equal),
                _ => Ok(Ordering::Greater),
            },
            Datum::Max => match *self {
                Datum::Max => Ok(Ordering::Equal),
                _ => Ok(Ordering::Less),
            },
            Datum::I64(i) => self.cmp_i64(ctx, i),
            Datum::U64(u) => self.cmp_u64(ctx, u),
            Datum::F64(f) => self.cmp_f64(ctx, f),
            Datum::Bytes(ref bs) => self.cmp_bytes(ctx, bs),
            Datum::Dur(d) => self.cmp_dur(ctx, d),
            Datum::Dec(ref d) => self.cmp_dec(ctx, d),
            Datum::Time(ref t) => self.cmp_time(ctx, t),
            Datum::Json(ref j) => self.cmp_json(ctx, j),
        }
    }
/// `cmp` compares the datum and returns an Ordering.
`cmp` compares the datum and returns an Ordering.
` cmp ` compares the datum and returns an Ordering .
pub fn cmp(&self, ctx: &mut EvalContext, datum: &Datum) -> Result<Ordering> {
        if let Datum::Json(_) = *self {
            if let Datum::Json(_) = *datum {
            } else {
                // reverse compare when self is json while datum not.
                let order = datum.cmp(ctx, self)?;
                return Ok(order.reverse());
            }
        }
        match *datum {
            Datum::Null => match *self {
                Datum::Null => Ok(Ordering::Equal),
                _ => Ok(Ordering::Greater),
            },
            Datum::Min => match *self {
                Datum::Null => Ok(Ordering::Less),
                Datum::Min => Ok(Ordering::Equal),
                _ => Ok(Ordering::Greater),
            },
            Datum::Max => match *self {
                Datum::Max => Ok(Ordering::Equal),
                _ => Ok(Ordering::Less),
            },
            Datum::I64(i) => self.cmp_i64(ctx, i),
            Datum::U64(u) => self.cmp_u64(ctx, u),
            Datum::F64(f) => self.cmp_f64(ctx, f),
            Datum::Bytes(ref bs) => self.cmp_bytes(ctx, bs),
            Datum::Dur(d) => self.cmp_dur(ctx, d),
            Datum::Dec(ref d) => self.cmp_dec(ctx, d),
            Datum::Time(ref t) => self.cmp_time(ctx, t),
            Datum::Json(ref j) => self.cmp_json(ctx, j),
        }
    }
pub fn cmp ( & self , ctx : & mut EvalContext , datum : & Datum ) -> Result < Ordering > { if let Datum :: Json ( _ ) = * self { if let Datum :: Json ( _ ) = * datum { } else { // reverse compare when self is json while datum not. let order = datum . cmp ( ctx , self ) ? ; return Ok ( order . reverse ( ) ) ; } } match * datum { Datum :: Null => match * self { Datum :: Null => Ok ( Ordering :: Equal ) , _ => Ok ( Ordering :: Greater ) , } , Datum :: Min => match * self { Datum :: Null => Ok ( Ordering :: Less ) , Datum :: Min => Ok ( Ordering :: Equal ) , _ => Ok ( Ordering :: Greater ) , } , Datum :: Max => match * self { Datum :: Max => Ok ( Ordering :: Equal ) , _ => Ok ( Ordering :: Less ) , } , Datum :: I64 ( i ) => self . cmp_i64 ( ctx , i ) , Datum :: U64 ( u ) => self . cmp_u64 ( ctx , u ) , Datum :: F64 ( f ) => self . cmp_f64 ( ctx , f ) , Datum :: Bytes ( ref bs ) => self . cmp_bytes ( ctx , bs ) , Datum :: Dur ( d ) => self . cmp_dur ( ctx , d ) , Datum :: Dec ( ref d ) => self . cmp_dec ( ctx , d ) , Datum :: Time ( ref t ) => self . cmp_time ( ctx , t ) , Datum :: Json ( ref j ) => self . cmp_json ( ctx , j ) , } }
`cmp` compares the datum and returns an Ordering.
` cmp ` compares the datum and returns an Ordering .
&self
ctx
&mut EvalContext
datum
&Datum
&self
ctx
&mut EvalContext
datum
&Datum