pub struct TypeQuery { /* private fields */ }Expand description
Query interface for the type database.
Implementations§
Source§impl TypeQuery
impl TypeQuery
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new TypeQuery from a database path.
Sourcepub fn warm_cache(&mut self) -> Result<()>
pub fn warm_cache(&mut self) -> Result<()>
Load all facts into the in-memory cache for O(1) lookups.
Sourcepub fn find_return_type(&mut self, module: &str, symbol: &str) -> Result<String>
pub fn find_return_type(&mut self, module: &str, symbol: &str) -> Result<String>
Look up a return type by fully qualified name.
DEPYLER-1115: Also tries common submodule paths for re-exported symbols.
For example, requests.get may actually be defined in requests.api.get.
Sourcepub fn find_fact(&mut self, module: &str, symbol: &str) -> Result<TypeFact>
pub fn find_fact(&mut self, module: &str, symbol: &str) -> Result<TypeFact>
Look up a complete TypeFact by fully qualified name.
DEPYLER-1115: Also tries common submodule paths for re-exported symbols.
Sourcepub fn find_functions(&mut self, module: &str) -> Result<Vec<TypeFact>>
pub fn find_functions(&mut self, module: &str) -> Result<Vec<TypeFact>>
Find all functions in a module.
Sourcepub fn find_classes(&mut self, module: &str) -> Result<Vec<TypeFact>>
pub fn find_classes(&mut self, module: &str) -> Result<Vec<TypeFact>>
Find all classes in a module.
Sourcepub fn find_methods(
&mut self,
module: &str,
class_name: &str,
) -> Result<Vec<TypeFact>>
pub fn find_methods( &mut self, module: &str, class_name: &str, ) -> Result<Vec<TypeFact>>
Find all methods of a class.
Sourcepub fn has_symbol(&mut self, module: &str, symbol: &str) -> bool
pub fn has_symbol(&mut self, module: &str, symbol: &str) -> bool
Check if a symbol exists in the database.
DEPYLER-1115: Also tries common submodule paths for re-exported symbols.
Auto Trait Implementations§
impl Freeze for TypeQuery
impl RefUnwindSafe for TypeQuery
impl Send for TypeQuery
impl Sync for TypeQuery
impl Unpin for TypeQuery
impl UnwindSafe for TypeQuery
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