Enum cranelift_isle::ast::Extern
source · [−]pub enum Extern {
Extractor {
term: Ident,
func: Ident,
pos: Pos,
arg_polarity: Option<Vec<ArgPolarity>>,
infallible: bool,
},
Constructor {
term: Ident,
func: Ident,
pos: Pos,
},
Const {
name: Ident,
ty: Ident,
pos: Pos,
},
}
Expand description
An external binding: an extractor or constructor function attached to a term.
Variants
Extractor
Fields
term: Ident
The term to which this external extractor is attached.
func: Ident
The Rust function name.
pos: Pos
The position of this decl.
arg_polarity: Option<Vec<ArgPolarity>>
Poliarity of args: whether values are inputs or outputs to the external extractor function. This is a sort of statically-defined approximation to Prolog-style unification; we allow for the same flexible directionality but fix it at DSL-definition time. By default, every arg is an output from the extractor (and the ’retval“, or more precisely the term value that we are extracting, is an “input”).
infallible: bool
Infallibility: if an external extractor returns (T1, T2, ...)
rather than Option<(T1, T2, ...)>
, and hence can
never fail, it is declared as such and allows for slightly
better code to be generated.
An external extractor: (extractor Term rustfunc)
form.
Constructor
Fields
term: Ident
The term to which this external constructor is attached.
func: Ident
The Rust function name.
pos: Pos
The position of this decl.
An external constructor: (constructor Term rustfunc)
form.
Const
An external constant: (const $IDENT type)
form.
Trait Implementations
impl Eq for Extern
impl StructuralEq for Extern
impl StructuralPartialEq for Extern
Auto Trait Implementations
impl RefUnwindSafe for Extern
impl Send for Extern
impl Sync for Extern
impl Unpin for Extern
impl UnwindSafe for Extern
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more