//
Busca en todas las páginas de la documentación
Arc<Mutex> proliferation in concurrent code.&T / owned T before Rc/Arc. Simpler ownership.Box for heap single owner or trait objects. Not default for all heap data.Rc single-thread only; Arc for threads. Compiler enforces Send where needed.RefCell only single-thread interior mutability. Mutex across threads.Cow for maybe-mutate borrowed text. Avoid gratuitous String params.Arc<Mutex> when possible. Clearer data flow.Mutex<u64> always.Mutex guards across .await. Use tokio::sync.Rc cycles with Weak back edges. Trees: parent Weak.Rc caches without eviction. Memory growth.Arc::clone hot paths. Atomic inc cost.Weak::upgrade handling None. Owner may be gone.Rc<RefCell> graphs. Performance.&str not Rc<str> unless sharing required. API simplicity.RefCell inside type; don't leak guards. Encapsulation.Deref not inheritance for newtypes. Transparent access.Drop documents safety invariants. Especially FFI.Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Revisado por Chris St. John·Última actualización: 16 jul 2026