sun::borrow_checker::Loan

sun::borrow_checker::Loan

struct · Source (opens in a new tab)

struct sun::borrow_checker::Loan

Represents an active borrow of a variable When ref r = x is executed, a Loan is created tracking that r borrows x.

Public Functions

Loan

Loan()=default

public · function · Source (opens in a new tab)

sun::borrow_checker::Loan::Loan()=default

Records a borrow, its reference binding, access mode, and lifetime.

Loan(std::string borrowed, std::string ref, BorrowKind k, size_t depth, sun::support::Position loc, Lifetime lt=Lifetime())

public · function · Source (opens in a new tab)

sun::borrow_checker::Loan::Loan(std::string borrowed, std::string ref, BorrowKind k, size_t depth, sun::support::Position loc, Lifetime lt=Lifetime())

Records a borrow, its reference binding, access mode, and lifetime.

Related: BorrowKind, sun::support::Position, Lifetime

isMutable

public · function · Source (opens in a new tab)

bool sun::borrow_checker::Loan::isMutable() const

Reports whether the loan grants exclusive write access to its target.

isShared

public · function · Source (opens in a new tab)

bool sun::borrow_checker::Loan::isShared() const

Reports whether the loan permits shared read access to its target.

Public Fields

borrowedVar

public · variable · Source (opens in a new tab)

std::string sun::borrow_checker::Loan::borrowedVar

No documentation comment.

isActive

public · variable · Source (opens in a new tab)

bool sun::borrow_checker::Loan::isActive = true

No documentation comment.

kind

public · variable · Source (opens in a new tab)

BorrowKind sun::borrow_checker::Loan::kind

No documentation comment.

Related: BorrowKind

lifetime

public · variable · Source (opens in a new tab)

Lifetime sun::borrow_checker::Loan::lifetime

No documentation comment.

Related: Lifetime

location

public · variable · Source (opens in a new tab)

sun::support::Position sun::borrow_checker::Loan::location

No documentation comment.

Related: sun::support::Position

refName

public · variable · Source (opens in a new tab)

std::string sun::borrow_checker::Loan::refName

No documentation comment.

scopeDepth

public · variable · Source (opens in a new tab)

size_t sun::borrow_checker::Loan::scopeDepth

No documentation comment.