Comprehensive Rust(English) 202412
collection. • Focuses on reliability and safety without sacrificing performance. 26 4.2 Benefits of Rust Some unique selling points of Rust: • Compile time memory safety - whole classes of memory bugs are dependency management. • Experience with Java, Go, Python, JavaScript...: You get the same memory safety as in those languages, plus a similar high-level language feeling. In addition you get fast and predictable functional language, it includes a range of functional concepts. 5.2 Variables Rust provides type safety via static typing. Variable bindings are made with let: fn main() { let x: i32 = 10; println!("x:0 码力 | 382 页 | 1.00 MB | 10 月前3Comprehensive Rust(Persian ) 202412
� . • � � � � � � � Java� Go� Python� JavaScript ...: � � � � � � � � � � � � � � � � � ) memory safety ( � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � " � � � � � � � � ! " ( ; let r1 = &mut s as *mut String ; let r2 = r1 as *const String ; / / SAFETY: r1 and r2 were obtained from references and so are guaranteed to / / be non-null and properly aligned add_to_counter(inc: u32 ( } / / SAFETY: There are no other threads which could be accessing `COUNTER ` . unsafe } COUNTER += inc ; { { fn main ) ( } add_to_counter(42 ( ; / / SAFETY: There are no other threads0 码力 | 393 页 | 987.97 KB | 10 月前3Comprehensive Rust ?
collection. • Focuses on reliability and safety without sacrificing performance. 25 4.2 Benefits of Rust Some unique selling points of Rust: • Compile time memory safety - whole classes of memory bugs are dependency management. • Experience with Java, Go, Python, JavaScript...: You get the same memory safety as in those languages, plus a similar high-level language feeling. In addition you get fast and predictable functional language, it includes a range of functional concepts. 5.2 Variables Rust provides type safety via static typing. Variable bindings are made with let: fn main() { let x: i32 = 10; println!("x:0 码力 | 378 页 | 1009.46 KB | 1 年前3Comprehensive Rust(简体中文) 202412
的宏只是 部分卫生。 • Rust 是多范式编程语言。例如,它具有强大的面向对象的编程功能,虽然它不是函数式语言,但包括 一系列的函数概念。 5.2 变量 Rust provides type safety via static typing. Variable bindings are made with let: fn main() { let x: i32 = 10; println!("x: question about modifying a[3] can spark an interesting discussion, but the answer is that for memory safety reasons you cannot do it through a at this point in the execution, but you can read the data from shared reference. The standard library provides several ways to do this, all while still ensuring safety, typically by performing a runtime check. RefCell use std::cell::RefCell; use std::rc::Rc; struct0 码力 | 359 页 | 1.33 MB | 10 月前3Comprehensive Rust(日语) 202412
などの構造要素を含 む現代的な言語です。 • Experience with Java, Go, Python, JavaScript...: You get the same memory safety as in those languages, plus a similar high-level language feeling. In addition you get fast and predictable { let mut s = String::from("careful!"); let r1 = &raw mut s; let r2 = r1 as *const String; // SAFETY: r1 and r2 were obtained from references and so are guaranteed to // be non-null and properly aligned add_to_counter(inc: u32) { // SAFETY: There are no other threads which could be accessing `COUNTER`. unsafe { COUNTER += inc; } } fn main() { add_to_counter(42); // SAFETY: There are no other threads0 码力 | 381 页 | 1.36 MB | 10 月前3Comprehensive Rust(Ukrainian) 202412
представлення і не має заповнення. unsafe impl IntoBytes for u32 {} У Rustdoc має бути розділ # Safety для трейту, що пояснює вимоги до безпечної реалізації функції. Фактичний розділ безпеки для IntoBytes test_multiline_string_diff() { let haiku = "Memory safety found,\n\ Rust's strong typing guides the way,\n\ Secure code you'll write."; assert_that!( haiku, eq("Memory safety found,\n\ Rust's silly humor guides the показано): Value of: haiku Expected: is equal to "Memory safety found,\nRust's silly humor guides the way,\nSecure code you'll write." Actual: "Memory safety found,\nRust's strong typing guides the way,\nSecure0 码力 | 396 页 | 1.08 MB | 10 月前3Comprehensive Rust(Español) 202412
developers have turned off some compiler safety features and have to write correct code by themselves. It means the compiler no longer enforces Rust's memory-safety rules. 30.2 Dereferenciación de Punteros s = String::from("¡cuidado!"); let r1 = &mut s as *mut String; let r2 = r1 as *const String; // SAFETY: r1 and r2 were obtained from references and so are guaranteed to // be non-null and properly aligned add_to_counter(inc: u32) { // SAFETY: There are no other threads which could be accessing `COUNTER`. unsafe { COUNTER += inc; } } fn main() { add_to_counter(42); // SAFETY: There are no other threads0 码力 | 389 页 | 1.04 MB | 10 月前32021-11-22 - Rust CTCFT - Rust for Linux
Pinning: init workaround example implMutex { /// Constructs a new mutex. /// /// # Safety /// /// The caller must call [`Mutex::init_lock`] before using the mutex. pub unsafe group_leader().clone(), // SAFETY: `inner` is initialised in the call to `mutex_init` below. inner: unsafe { Mutex::new(ProcessInner::new()) }, // SAFETY: `node_refs` is initialised in // SAFETY: `inner` is pinned when `Process` is. let pinned = unsafe { process.as_mut().map_unchecked_mut(|p| &mut p.inner) }; mutex_init!(pinned, "Process::inner"); // SAFETY: `node_refs` 0 码力 | 53 页 | 332.50 KB | 9 月前3The Rust Programming Language,2nd Edition
Programming Language,” an introductory book about Rust. Rust is a programming language that’s focused on safety, speed, and concurrency. Its design lets you create programs that have the performance and control code that performs better without sacrificing expressiveness. Rust performs the majority of its safety checks and memory man- agement decisions at compile time, so that your program’s runtime performance of many nudges in Rust that encourages you to write your code in a way that takes advantage of the safety and easy concurrency that Rust offers. However, you still have the option to make your variables0 码力 | 617 页 | 1.54 MB | 1 年前3Comprehensive Rust(繁体中文)
部分衛生的巨集。 • Rust 是多範式的語言。舉例來說,它具備強大的物件導向程式設計功能,雖然並非函式語言,卻涉及 各式各樣的函式概念。 5.2 變數 Rust provides type safety via static typing. Variable bindings are made with let: fn main() { let x: i32 = 10; println!("x: question about modifying a[3] can spark an interesting discussion, but the answer is that for memory safety reasons you cannot do it through a at this point in the execution, but you can read the data from developers have turned off some compiler safety features and have to write correct code by themselves. It means the compiler no longer enforces Rust's memory-safety rules. 174 30.2 對裸指標解參考 建立指標相當安全,不過對指標解參考就需要使用0 码力 | 358 页 | 1.41 MB | 10 月前3
共 31 条
- 1
- 2
- 3
- 4