FIND YOUR NEXT FEW LINES

The snippet library.

Small, practical examples. Search by task or narrow things down below.

9 snippets foundClear filters
RustFiles & paths

Append to a file without truncating it

Append to a file without truncating it in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Change a path’s extension

Change a path’s extension in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Copy a file and inspect the copied byte count

Copy a file and inspect the copied byte count in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Create a file without replacing existing data

Create a file without replacing existing data in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Create a nested directory tree

Create a nested directory tree in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Inspect a path’s filename and extension

Inspect a path’s filename and extension in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Read buffered lines from a file

Read buffered lines from a file in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Read file metadata without reading its contents

Read file metadata without reading its contents in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Write and read a UTF-8 file

Write and read a UTF-8 file in a complete Rust program using the standard library.

Rust✓ Tested