pub enum ArgShape {
Variable,
Atom {
name: String,
},
Integer,
Float,
Binary,
List,
Tuple {
size: usize,
},
Record {
name: RecordName,
},
String,
Fun,
Unknown,
}Variants§
Variable
Variable identifier (starts with _ or capital letter).
Atom
Atom literal: foo, 'quoted atom'.
Integer
Integer literal.
Float
Float literal.
Binary
Binary literal: <<...>>.
List
List literal: [...].
Tuple
Tuple literal: {...} (size is the number of elements).
Record
Record reference: #name{...}.
Fields
name: RecordNameString
String literal: "...".
Fun
Anonymous fun: fun ... end or fun mod:f/A.
Unknown
Anything the extractor cannot classify. Always matches.
Implementations§
Source§impl ArgShape
impl ArgShape
Sourcepub fn satisfies(&self, pattern: &ArgShape) -> bool
pub fn satisfies(&self, pattern: &ArgShape) -> bool
Returns true when self (a call-site argument) is acceptable
against pattern (a clause-head argument at the pin).
Conservative: we only return false when we can prove a
mismatch from static information. Anything we can’t classify
confidently is treated as a potential match.
Unknown on either side accepts anything. Variable on either
side accepts anything too: a call-site variable can hold any
runtime value, and a clause-head variable binds to any input.