pub struct MypyTypeIntrospector { /* private fields */ }Expand description
Mypy-based type introspection using dmypy daemon
Implementations§
Source§impl MypyTypeIntrospector
impl MypyTypeIntrospector
pub fn new(workspace_root: Option<&str>) -> Result<Self, String>
Sourcepub fn ensure_daemon_started(&mut self) -> Result<(), String>
pub fn ensure_daemon_started(&mut self) -> Result<(), String>
Start the mypy daemon if not already running
Sourcepub fn get_type_at_position(
&mut self,
file_path: &str,
line: usize,
column: usize,
) -> Result<Option<String>, String>
pub fn get_type_at_position( &mut self, file_path: &str, line: usize, column: usize, ) -> Result<Option<String>, String>
Get the type of an expression at a specific location
Sourcepub fn resolve_type_fqn(
&mut self,
_file_path: &str,
type_name: &str,
) -> Result<Option<String>, String>
pub fn resolve_type_fqn( &mut self, _file_path: &str, type_name: &str, ) -> Result<Option<String>, String>
Get the fully qualified name of a type
Sourcepub fn invalidate_file(&mut self, file_path: &str) -> Result<(), String>
pub fn invalidate_file(&mut self, file_path: &str) -> Result<(), String>
Invalidate cached type information for a file after modifications
Sourcepub fn stop_daemon(&mut self) -> Result<(), String>
pub fn stop_daemon(&mut self) -> Result<(), String>
Stop the dmypy daemon
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MypyTypeIntrospector
impl RefUnwindSafe for MypyTypeIntrospector
impl Send for MypyTypeIntrospector
impl Sync for MypyTypeIntrospector
impl Unpin for MypyTypeIntrospector
impl UnsafeUnpin for MypyTypeIntrospector
impl UnwindSafe for MypyTypeIntrospector
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more