pub struct TypeEnvironment { /* private fields */ }Expand description
Type inference types: Perl types, constraints, and inference engine. Type environment for tracking variable types
Implementations§
Source§impl TypeEnvironment
impl TypeEnvironment
Sourcepub fn new() -> TypeEnvironment
pub fn new() -> TypeEnvironment
Creates a new empty type environment
Sourcepub fn with_parent(parent: TypeEnvironment) -> TypeEnvironment
pub fn with_parent(parent: TypeEnvironment) -> TypeEnvironment
Creates a new type environment with a parent scope
Sourcepub fn set_variable(&mut self, name: String, ty: PerlType)
pub fn set_variable(&mut self, name: String, ty: PerlType)
Sets the type for a variable in the current scope
Sourcepub fn get_variable(&self, name: &str) -> Option<&PerlType>
pub fn get_variable(&self, name: &str) -> Option<&PerlType>
Gets the type of a variable, searching parent scopes if needed
Sourcepub fn set_subroutine(&mut self, name: String, ty: PerlType)
pub fn set_subroutine(&mut self, name: String, ty: PerlType)
Sets the type signature for a subroutine in the current scope
Sourcepub fn get_subroutine(&self, name: &str) -> Option<&PerlType>
pub fn get_subroutine(&self, name: &str) -> Option<&PerlType>
Gets the type signature of a subroutine, searching parent scopes if needed
Trait Implementations§
Source§impl Clone for TypeEnvironment
impl Clone for TypeEnvironment
Source§fn clone(&self) -> TypeEnvironment
fn clone(&self) -> TypeEnvironment
Returns a duplicate of the value. Read more
1.0.0 · 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 TypeEnvironment
impl Debug for TypeEnvironment
Source§impl Default for TypeEnvironment
impl Default for TypeEnvironment
Source§fn default() -> TypeEnvironment
fn default() -> TypeEnvironment
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeEnvironment
impl RefUnwindSafe for TypeEnvironment
impl Send for TypeEnvironment
impl Sync for TypeEnvironment
impl Unpin for TypeEnvironment
impl UnsafeUnpin for TypeEnvironment
impl UnwindSafe for TypeEnvironment
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