Unsized Types There is a new edition of the book and this is an old link. Sometimes referred to as ‘DSTs’ or ‘unsized types’, these types let us talk about types whose size we can only know at runtime. The Sized trait is automatically implemented for everything the compiler knows the size of at compile time. A trait bound on ?Sized is the opposite of a trait bound on Sized; that is, we would read
JSON parsing and serialization What is JSON? JSON (JavaScript Object Notation) is a way to write data in Javascript. Like XML, it allows to encode structured data in a text format that can be easily read by humans Its simple syntax and native compatibility with JavaScript have made it a widely used format. Data types that can be encoded are JavaScript types (see the Json enum for more details): I6
If you are not automatically redirected to the error code index, please here.
String slices. See also the std::str module. The str type, also called a ‘string slice’, is the most primitive string type. It is usually seen in its borrowed form, &str. It is also the type of string literals, &'static str. §Basic Usage String literals are string slices: Here we have declared a string slice initialized with a string literal. String literals have a static lifetime, which means the
Effective Rust There is a new edition of the book and this is an old link. This section does not exist in the second edition. However, the second edition encourages writing effective Rust from the start. It is recommended to start there. The second edition of The Rust Programming Language In the first edition: Ch 4 — Effective Rust
The Rust Programming Language There are two editions of “The Rust Programming Language”: First edition Second edition The second edition is a complete re-write. It is still under construction; though it is far enough along to learn most of Rust; we suggest reading the second edition and then checking out the first edition later to pick up some of the more esoteric parts of the language.
The Rust Programming Language by Steve Klabnik and Carol Nichols, with contributions from the Rust Community This version of the text assumes you’re using Rust 1.67.1 (released 2023-02-09) or later. See the “Installation” section of Chapter 1 to install or update Rust. The HTML format is available online at https://doc.rust-lang.org/stable/book/ and offline with installations of Rust made with rus
Ownership There is a new edition of the book and this is an old link. Ownership is Rust’s most unique feature, and it enables Rust to make memory safety guarantees without needing a garbage collector. Each value in Rust has a variable that’s called its owner. There can only be one owner at a time. When the owner goes out of scope, the value will be dropped. Here are the relevant sections in the ne
The Rust Programming Language by Steve Klabnik and Carol Nichols, with contributions from the Rust Community This version of the text assumes you’re using Rust 1.76.0 (released 2024-02-08) or later. See the “Installation” section of Chapter 1 to install or update Rust. The HTML format is available online at https://doc.rust-lang.org/stable/book/ and offline with installations of Rust made with rus
Encodes a URI by replacing reserved characters with percent-encoded character sequences. This function is compliant with RFC 3986. Exampleextern crate url; fn main() { #![allow(deprecated)] use url::encode; let url = encode("https://example.com/Rust (programming language)"); println!("{}", url); // https://example.com/Rust%20(programming%20language) }use url::encode; let url = encode("https://exam
Rust Inside Other Languages For our third project, we’re going to choose something that shows off one of Rust’s greatest strengths: a lack of a substantial runtime. As organizations grow, they increasingly rely on a multitude of programming languages. Different programming languages have different strengths and weaknesses, and a polyglot stack lets you use a particular language where its strengths
Error Handling There is a new edition of the book and this is an old link. Rust groups errors into two major categories: recoverable errors with Result<T, E> and unrecoverable errors with panic!. Here are the relevant sections in the new and old books: in the current edition: Ch 9.00 — Error Handling In the first edition: Ch 4.7 — Error Handling
Error Handling There is a new edition of the book and this is an old link. Rust groups errors into two major categories: recoverable errors with Result<T, E> and unrecoverable errors with panic!. Here are the relevant sections in the new and old books: in the current edition: Ch 9.00 — Error Handling In the first edition: Ch 4.7 — Error Handling
Affectionately nicknamed “the book,” The Rust Programming Language will give you an overview of the language from first principles. You’ll build a few projects along the way, and by the end, you’ll have a solid grasp of the language. Alternatively, Rustlings guides you through downloading and setting up the Rust toolchain, and teaches you the basics of reading and writing Rust syntax, on the comma
FFI There is a new edition of the book and this is an old link. Sometimes, your Rust code may need to interact with code written in another language. To do this, Rust has a keyword, extern, that facilitates creating and using a Foreign Function Interface (FFI). extern "C" { fn abs(input: i32) -> i32; } fn main() { unsafe { println!("Absolute value of -3 according to C: {}", abs(-3)); } }Run You ca
Utilities for program-wide and customizable logging Example#![feature(phase)] #[phase(plugin, link)] extern crate log; fn main() { debug!("this is a debug {}", "message"); error!("this is printed by default"); if log_enabled!(log::INFO) { let x = 3i * 4i; // expensive computation info!("the answer was: {}", x); } }#![feature(phase)] #[phase(plugin, link)] extern crate log; fn main() { debug!("this
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く