Hello,
The ref manual speaks of copying pointers
[http://static.rust-lang.org/doc/0.8/rust.html#pointer-types]:
<<
Managed pointers (@)
These point to managed heap allocations (or "boxes") in the task-local,
managed heap. Managed pointers are written @content, for example @int means a
managed pointer to a managed box containing an integer. Copying a managed
pointer is a "shallow" operation: it involves only copying the pointer itself
(as well as any reference-count or GC-barriers required by the managed heap).
Dropping a managed pointer does not necessarily release the box it points to;
the lifecycles of managed boxes are subject to an unspecified garbage collection
algorithm.
Owning pointers (~)
These point to owned heap allocations (or "boxes") in the shared,
inter-task heap. Each owned box has a single owning pointer; pointer and pointee
retain a 1:1 relationship at all times. Owning pointers are written ~content,
for example ~int means an owning pointer to an owned box containing an integer.
Copying an owned box is a "deep" operation: it involves allocating a new owned
box and copying the contents of the old box into the new box. Releasing an
owning pointer immediately releases its corresponding owned box.
Borrowed pointers (&)
These point to memory owned by some other value. Borrowed pointers arise by
(automatic) conversion from owning pointers, managed pointers, or by applying
the borrowing operator & to some other value, including lvalues, rvalues or
temporaries. Borrowed pointers are written &content, or in some cases &f/content
for some lifetime-variable f, for example &int means a borrowed pointer to an
integer. Copying a borrowed pointer is a "shallow" operation: it involves only
copying the pointer itself. Releasing a borrowed pointer typically has no effect
on the value it points to, with the exception of temporary values, which are
released when the last borrowed pointer to them is released.
But what is the syntax to do that? I always get errors related to moving, which
i don' twant to do. In particular, how does one establish or modify link list links?
Denis
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev