pub struct CompilationUnit {
pub decls: Vec<Decl>,
pub body: Option<Arc<Expr>>,
}Fields§
§decls: Vec<Decl>§body: Option<Arc<Expr>>Implementations§
Source§impl CompilationUnit
impl CompilationUnit
Sourcepub fn body_with_fns(&self) -> Option<Arc<Expr>>
pub fn body_with_fns(&self) -> Option<Arc<Expr>>
Lower top-level fn declarations into nested let bindings around body.
This keeps the surface syntax (Decl::Fn) intact for tools, while giving
the type checker and evaluator a plain expression to work with.
Trait Implementations§
Source§impl Clone for CompilationUnit
impl Clone for CompilationUnit
Source§fn clone(&self) -> CompilationUnit
fn clone(&self) -> CompilationUnit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompilationUnit
impl Debug for CompilationUnit
Source§impl<'de> Deserialize<'de> for CompilationUnit
impl<'de> Deserialize<'de> for CompilationUnit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CompilationUnit
impl PartialEq for CompilationUnit
Source§fn eq(&self, other: &CompilationUnit) -> bool
fn eq(&self, other: &CompilationUnit) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CompilationUnit
impl Serialize for CompilationUnit
impl StructuralPartialEq for CompilationUnit
Auto Trait Implementations§
impl Freeze for CompilationUnit
impl RefUnwindSafe for CompilationUnit
impl Send for CompilationUnit
impl Sync for CompilationUnit
impl Unpin for CompilationUnit
impl UnsafeUnpin for CompilationUnit
impl UnwindSafe for CompilationUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more