MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / as_const

Method as_const

src/expr/src/relation.rs:1096–1102  ·  view source on GitHub ↗

If self is a constant, return the value and the type, otherwise `None`. Looks behind `ArrangeBy`s.

(&self)

Source from the content-addressed store, hash-verified

1094 /// If self is a constant, return the value and the type, otherwise `None`.
1095 /// Looks behind `ArrangeBy`s.
1096 pub fn as_const(&self) -> Option<(&Result<Vec<(Row, Diff)>, EvalError>, &ReprRelationType)> {
1097 match self {
1098 MirRelationExpr::Constant { rows, typ } => Some((rows, typ)),
1099 MirRelationExpr::ArrangeBy { input, .. } => input.as_const(),
1100 _ => None,
1101 }
1102 }
1103
1104 /// If self is a constant, mutably return the value and the type, otherwise `None`.
1105 /// Looks behind `ArrangeBy`s.

Callers 2

is_constant_singletonMethod · 0.45
is_emptyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected