pub struct ModularTypeExtractor { /* private fields */ }Expand description
Type extractor for analyzing type definitions from Rust code
Implementations§
Source§impl TypeExtractor
impl TypeExtractor
Sourcepub fn new(config: GeneratorConfig) -> TypeExtractor
pub fn new(config: GeneratorConfig) -> TypeExtractor
Create a new type extractor with the given configuration
Sourcepub fn extract_types(
&mut self,
_crate_info: &CrateInfo,
) -> Result<Vec<TypeInfo>, SklearsError>
pub fn extract_types( &mut self, _crate_info: &CrateInfo, ) -> Result<Vec<TypeInfo>, SklearsError>
Extract types from crate information
Sourcepub fn extract_type(
&mut self,
type_name: &str,
) -> Result<Option<TypeInfo>, SklearsError>
pub fn extract_type( &mut self, type_name: &str, ) -> Result<Option<TypeInfo>, SklearsError>
Extract a specific type by name
Sourcepub fn get_cached_types(&self) -> &HashMap<String, TypeInfo>
pub fn get_cached_types(&self) -> &HashMap<String, TypeInfo>
Get all cached type information
Sourcepub fn analyze_generic_constraints(
&mut self,
type_name: &str,
) -> Result<Vec<String>, SklearsError>
pub fn analyze_generic_constraints( &mut self, type_name: &str, ) -> Result<Vec<String>, SklearsError>
Analyze generic constraints for a type
Trait Implementations§
Source§impl Clone for TypeExtractor
impl Clone for TypeExtractor
Source§fn clone(&self) -> TypeExtractor
fn clone(&self) -> TypeExtractor
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 TypeExtractor
impl Debug for TypeExtractor
Source§impl Default for TypeExtractor
impl Default for TypeExtractor
Source§fn default() -> TypeExtractor
fn default() -> TypeExtractor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeExtractor
impl RefUnwindSafe for TypeExtractor
impl Send for TypeExtractor
impl Sync for TypeExtractor
impl Unpin for TypeExtractor
impl UnwindSafe for TypeExtractor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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