core::marker
API 參考只有英文版,由標準函式庫原始碼中的英文文件註解產生。
Marker traits used by #[derive(..)] and other compiler-driven
semantics.
The comparison / hashing traits live in cmp.nabi.
Structs
HandoffSource
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). The toolchain's own: code elsewhere moves
the value into the closure ([move x]) or hands it over.
The wrapped value.
Traits
CloneSource
pub trait CloneAn explicit duplicate: x.clone(); #[derive(Clone)] clones every
field.
A copy of
self; collections copy their elements.
DefaultSource
pub trait DefaultA type's default value (0, false, '\0', "", empty
collections); #[derive(Default)] defaults every field.
The default value of
Self.
CopySource
pub trait Copy: CloneBitwise copy is a correct duplicate. A marker: every
value already copies on let y = x;; #[derive(Copy)] checks that
every field is Copy and the type is not Drop.
DropSource
pub trait DropCleanup on release. A Drop value has one owner: let b = a
moves it, and the compiler calls drop where its owner leaves scope (on
every exit, and when a task ends) or where a using block
ends.
Releases what
selfholds; called once, where the value is released.
SendSource
pub trait SendSafe to move to another thread.
SyncSource
pub trait SyncSafe to read through shared references from several threads.
Type aliases
NoneSentinelSource
pub type NoneSentinel = noneThe type of the none literal: the compiler's
built-in none, here under its library name.
Functions
replaceSource
pub fn replace<T>(ref dest: T, value: T) -> T Put value into dest and return what it held: the way to move a
part out of a struct (replace(ref s.part, none), as
Child::take_stdout does).
takeSource
pub fn take<T: Default>(ref dest: T) -> T replace(ref dest, T::default()).