Struct expr_test_util::MirScalarExprDeserializeContext [−][src]
pub struct MirScalarExprDeserializeContext;
Expand description
Extends the test case syntax to support MirScalarExpr
s
The following variants of MirScalarExpr
have non-standard syntax:
Literal -> the syntax is (ok <literal> <scalar type>)
, <literal>
or (err ok
token can be omitted.
If <scalar type>
is not specified, then literals will be assigned
default types:
- true/false become Bool
- numbers become Int64
- strings become String
- Bool for literal errors
Column -> the syntax is
#n
, where n is the column number.
Implementations
pub(crate) fn build_column(
&mut self,
token: Option<TokenTree>
) -> Result<MirScalarExpr, String>
pub(crate) fn build_literal_if_able<I>(
&mut self,
first_arg: TokenTree,
rest_of_stream: &mut I,
rti: &ReflectedTypeInfo
) -> Result<Option<MirScalarExpr>, String> where
I: Iterator<Item = TokenTree>,
pub(crate) fn build_literal_ok_if_able<I>(
&mut self,
first_arg: TokenTree,
rest_of_stream: &mut I
) -> Result<Option<MirScalarExpr>, String> where
I: Iterator<Item = TokenTree>,
Trait Implementations
Returns the “default value” for a type. Read more
Override the way that first_arg
is resolved to JSON. Read more
fn reverse_syntax_override(
&mut self,
json: &Value,
type_name: &str,
rti: &ReflectedTypeInfo
) -> Option<String>
fn reverse_syntax_override(
&mut self,
json: &Value,
type_name: &str,
rti: &ReflectedTypeInfo
) -> Option<String>
Converts json
back to the extended syntax specified by
TestDeserializeContext::override_syntax. Read more
Auto Trait Implementations
impl Send for MirScalarExprDeserializeContext
impl Sync for MirScalarExprDeserializeContext
impl Unpin for MirScalarExprDeserializeContext
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more