method Rc.new
A new reference-counted pointer to value.
Example:
fn main() io {
let a: Rc<str> = Rc.new("shared")
print("ok")
}Output
ok
pub(api) static fn new(value: T) -> Rc<T>Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
value | T |
Returns
Rc<T>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/task.oxl:167