API reference
python:astx:astx.borrows.BorrowDeclaration
class BorrowDeclaration
BorrowDeclaration(name: str, type_: DataType, source: Expr, access: BorrowAccess, *, mutability: MutabilityKind = MutabilityKind.mutable, loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/borrows.py:33
Declare a local borrow of a place.
Attributes
-
kind — Kind of syntax node.; Type: ASTKind
-
access — Access granted through the binding.; Type: BorrowAccess
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
mutability — Type: MutabilityKind
-
visibility — Type: VisibilityKind
-
scope — Type: ScopeKind
-
name — Type: str
-
type_ — Type: DataType
-
value — Type: Expr
Methods
-
__init__ — Initialize a local borrow declaration.
-
get_struct — Represent a borrow initializer with its access mode.