Glossary coding Term Page

Borrowing

Temporary access through references without transferring ownership

borrowing #rust#reference#safety
Korean version

Aliases

reference borrowing

Prerequisites

Related Concepts

Core Idea

Borrowing means temporarily using a value through references instead of taking ownership of it. That lets Rust functions work with data while the original owner remains responsible for cleanup.

The key is separating access rights from ownership. Rules about multiple read-only references versus a single mutable reference exist to stop conflicts before the program runs. Borrowing is therefore not an exception to ownership but the flexible extension that makes ownership practical.

Why It Matters Here

Mathbong uses borrowing as the link between Rust function signatures, references, and string handling. Once learners feel what it means to "borrow instead of take," Rust code becomes much easier to read.

Posts Mentioning This Concept