sun::borrow_checker::Loan
struct · Source (opens in a new tab)
struct sun::borrow_checker::LoanRepresents 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()=defaultRecords 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() constReports 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() constReports 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::borrowedVarNo documentation comment.
isActive
public · variable · Source (opens in a new tab)
bool sun::borrow_checker::Loan::isActive = trueNo documentation comment.
kind
public · variable · Source (opens in a new tab)
BorrowKind sun::borrow_checker::Loan::kindNo documentation comment.
Related: BorrowKind
lifetime
public · variable · Source (opens in a new tab)
Lifetime sun::borrow_checker::Loan::lifetimeNo documentation comment.
Related: Lifetime
location
public · variable · Source (opens in a new tab)
sun::support::Position sun::borrow_checker::Loan::locationNo documentation comment.
Related: sun::support::Position
refName
public · variable · Source (opens in a new tab)
std::string sun::borrow_checker::Loan::refNameNo documentation comment.
scopeDepth
public · variable · Source (opens in a new tab)
size_t sun::borrow_checker::Loan::scopeDepthNo documentation comment.