Back to Browse

Buffers | Rust Language

597 views
Oct 20, 2023
7:25

Buffers in Rust! - In this video I demonstrate code to read a text file into a buffer as bytes and display the number of bytes. 🟩 A buffer is typically a block of memory used for temporary storage of data. Buffers are commonly used when reading or writing data to or from sources like files, network sockets, or memory. 🟩 They help optimize I/O operations by reducing the number of system calls or memory allocations. 🟩 Most byte streams in Rust implement Read trait - it works by reading some number of bytes (1024 in this case) from a source (in this case, the "example.txt" file) and stores them in buf, which the program can then process. ! Note: the iterator will return a result, not bytes! Buffer example to print to screen with VGA: πŸ”— https://os.phil-opp.com/minimal-rust-kernel/#printing-to-screen πŸ”— https://os.phil-opp.com/vga-text-mode/#the-vga-text-buffer πŸ“Œ The full code and notes are available at πŸ”— https://redandgreen.co.uk/buffers-in-rust/rust-programming/ { - Web Hosting - Linux VPS - } 🟩 Webdock Hosting : πŸ”— https://webdock.io/en?maff=wdaff--170 🟩 Webdock is easy Cloud Hosting designed for Agencies, Developers and Business #rustlang #t-rec #buffers

Download

1 formats

Video Formats

360pmp411.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Buffers | Rust Language | NatokHD