pub(crate) struct TypeExpressionQualifier;Expand description
Type expression qualifier that rewrites identifiers based on module context.
Implementations§
Source§impl TypeExpressionQualifier
impl TypeExpressionQualifier
Sourcepub(crate) fn qualify_expression(
expr: &str,
type_refs: &HashMap<String, TypeIdentifierRef>,
target_module: &str,
) -> String
pub(crate) fn qualify_expression( expr: &str, type_refs: &HashMap<String, TypeIdentifierRef>, target_module: &str, ) -> String
Qualify a type expression based on the type references
This rewrites bare identifiers in the expression to add module qualifiers when necessary, based on the import context.
§Parameters
expr: The type expression to qualifytype_refs: Map of type names to their module referencestarget_module: The module where this type expression will be used
Sourcefn is_python_builtin(identifier: &str) -> bool
fn is_python_builtin(identifier: &str) -> bool
Check if an identifier is a known Python builtin or typing construct
Auto Trait Implementations§
impl Freeze for TypeExpressionQualifier
impl RefUnwindSafe for TypeExpressionQualifier
impl Send for TypeExpressionQualifier
impl Sync for TypeExpressionQualifier
impl Unpin for TypeExpressionQualifier
impl UnwindSafe for TypeExpressionQualifier
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> 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