// Evaluates expr in the context of frame (or in global context if frame is None)
// Returns expressions.Value or SBValue on success, SBError on failure.
Evaluates expr in the context of frame (or in global context if frame is None)
Returns expressions.Value or SBValue on success, SBError on failure.
Evaluates expr in the context of frame ( or in global context if frame is None ) Returns expressions . Value or SBValue on success SBError on failure .
fn evaluate_expr_in_frame(
        &self,
        expression: &PreparedExpression,
        frame: Option<&SBFrame>,
    ) -> Result<SBValue, Error> {
        match (expression, self.python.as_ref()) {
            (PreparedExpression::Native(pp_expr), _) => {
                let result = match frame {
                    Some(frame) => frame.evaluate_expression(&pp_expr).into_result(),
                    None => self.target.evaluate_expression(&pp_expr).into_result(),
                };
                result.map_err(|e| e.into())
            }
            (PreparedExpression::Python(pp_expr), Some(python)) => {
                let context = self.context_from_frame(frame);
                python.evaluate(&pp_expr, false, &context).map_err(|s| UserError(s).into())
            }
            (PreparedExpression::Simple(pp_expr), Some(python)) => {
                let context = self.context_from_frame(frame);
                python.evaluate(&pp_expr, true, &context).map_err(|s| UserError(s).into())
            }
            _ => Err(UserError("Python expressions are disabled.".into()))?,
        }
    }
fn evaluate_expr_in_frame ( & self , expression : & PreparedExpression , frame : Option < & SBFrame > , ) -> Result < SBValue , Error > { match ( expression , self . python . as_ref ( ) ) { ( PreparedExpression :: Native ( pp_expr ) , _ ) => { let result = match frame { Some ( frame ) => frame . evaluate_expression ( & pp_expr ) . into_result ( ) , None => self . target . evaluate_expression ( & pp_expr ) . into_result ( ) , } ; result . map_err ( | e | e . into ( ) ) } ( PreparedExpression :: Python ( pp_expr ) , Some ( python ) ) => { let context = self . context_from_frame ( frame ) ; python . evaluate ( & pp_expr , false , & context ) . map_err ( | s | UserError ( s ) . into ( ) ) } ( PreparedExpression :: Simple ( pp_expr ) , Some ( python ) ) => { let context = self . context_from_frame ( frame ) ; python . evaluate ( & pp_expr , true , & context ) . map_err ( | s | UserError ( s ) . into ( ) ) } _ => Err ( UserError ( " " . into ( ) ) ) ? , } }
Evaluates expr in the context of frame (or in global context if frame is None)
Returns expressions.Value or SBValue on success, SBError on failure.
Evaluates expr in the context of frame ( or in global context if frame is None ) Returns expressions . Value or SBValue on success SBError on failure .
&self
expression
&PreparedExpression
frame
Option<&SBFrame>