References
References are denoted with a reference token.
let variable = &expressionThere are two types of references:
Unique
Shared
Unique references are denoted with a unique token in front of the reference token.
let variable = ~&expressionReferences may also appear in type ascriptions.
let variable: &Type = &expressionDereference
References can be dereferenced with the dereference operator.
let reference = &expression
let variable = *referenceThis accesses the value that the reference is referencing.
Last updated
Was this helpful?