rok::core::marker
Marker traits used by #[derive(...)] (spec 6.2/6.4) and other
compiler-driven semantics. Slots follow stdlib spec 0.4 (6.4.8).
The comparison / hashing traits live in cmp.rok.
Structs
Handoff
pub struct Handoff<T>A value handed between threads under an outside protocol (a join,
a lock, a channel hand-off) that keeps any two threads from using it
at once: Send + Sync whenever the value is Send, even when it is
not Sync (a collection).
pub const unsafe fn new(value: T) -> Handoff<T>The caller guarantees the protocol: no two threads use
value(or another copy of its handle) at the same time.pub const fn get(self) -> T
Trait implementations 2
unsafe impl<T: Send> Send for Handoff<T>unsafe impl<T: Send> Sync for Handoff<T>
Memo
pub struct MemoThe copies one hand-off made, by original object, and the copied
buffers left to fix. none for one collection whose elements need no
copy: nothing can be reached twice. A visit (distinct) notes what
each item reaches in vis instead.
Traits
Clone
pub trait Clonefn clone(self) -> Self
Default
pub trait DefaultA type's default value (0, false, '\0', "", empty
collections); #[derive(Default)] defaults every field.
fn default() -> Self
Copy
pub trait Copy: CloneBitwise copy is a correct duplicate (stdlib 2.13.3). A marker: every
value already copies on let y = x;; #[derive(Copy)] checks that
every field is Copy and the type is not Drop.
Drop
pub trait Dropfn drop(ref self)
Send
pub trait SendSync
pub trait SyncTransfer
pub trait TransferHow a standard handle copies itself for a hand-off: transfer_copy
makes the copy (its elements queued on the memo), transfer_keep
notes the handle as its own copy. Only the compiler's list of
standard types is called; other impls are ignored.
fn transfer_copy(self, m: Memo) -> Selffn transfer_keep(self, m: Memo) -> Selffn transfer_visit(self, m: Memo) -> SelfNote the handle for the memo's owner (
Memo::visit), its elements queued.
Type aliases
NoneSentinel
pub type NoneSentinel = noneThe type of the none literal (stdlib 2.13.8): the compiler's
built-in none, here under its library name.
Functions
default_of
pub const fn default_of<T: Default>() -> TT::default() where only the expected type names T
(#[derive(Default)] field initializers).
hand_over
pub fn hand_over<T>(x: T) -> TWhat a hand-off gives the new owner: x with a copy of every
collection it reaches (x itself, with no call, when there are none).