pub struct TypeIntrospectionContext { /* private fields */ }Expand description
Context that holds type introspection clients across multiple file migrations
Implementations§
Source§impl TypeIntrospectionContext
impl TypeIntrospectionContext
Sourcepub fn new(method: TypeIntrospectionMethod) -> Result<Self>
pub fn new(method: TypeIntrospectionMethod) -> Result<Self>
Create a new type introspection context
Sourcepub fn new_with_workspace(
method: TypeIntrospectionMethod,
workspace_root: Option<&str>,
) -> Result<Self>
pub fn new_with_workspace( method: TypeIntrospectionMethod, workspace_root: Option<&str>, ) -> Result<Self>
Create a new type introspection context with a specific workspace root
Sourcepub fn method(&self) -> TypeIntrospectionMethod
pub fn method(&self) -> TypeIntrospectionMethod
Get the type introspection method
Sourcepub fn pyright_client(
&self,
) -> Option<Rc<RefCell<Box<dyn PyrightLspClientTrait>>>>
pub fn pyright_client( &self, ) -> Option<Rc<RefCell<Box<dyn PyrightLspClientTrait>>>>
Get a clone of the pyright client if available
Sourcepub fn mypy_client(&self) -> Option<Rc<RefCell<MypyTypeIntrospector>>>
pub fn mypy_client(&self) -> Option<Rc<RefCell<MypyTypeIntrospector>>>
Get a clone of the mypy client if available
Sourcepub fn open_file(&mut self, file_path: &Path, content: &str) -> Result<()>
pub fn open_file(&mut self, file_path: &Path, content: &str) -> Result<()>
Open a file for type introspection
Sourcepub fn update_file(&mut self, file_path: &Path, content: &str) -> Result<()>
pub fn update_file(&mut self, file_path: &Path, content: &str) -> Result<()>
Update a file after modifications
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if the context has been shutdown
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeIntrospectionContext
impl !RefUnwindSafe for TypeIntrospectionContext
impl !Send for TypeIntrospectionContext
impl !Sync for TypeIntrospectionContext
impl Unpin for TypeIntrospectionContext
impl UnsafeUnpin for TypeIntrospectionContext
impl !UnwindSafe for TypeIntrospectionContext
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