Ownership
Ownership is a programming-language model that assigns responsibility for a value or resource and governs its access, lifetime, and eventual cleanup.
Learn Rust in a Month of Lunches
Ownership is Rust's rule-based model in which each value has a responsible binding that controls the value's lifetime and access.
- How it is used
- Introduces ownership as a way to reason about Rust memory use and decide how functions receive data.
- How deep it goes
- Explains moves, borrowing, scope, cleanup, Copy, and cloning through examples and compiler feedback.
- Examples
- Uses a moved String passed to a printing function, a borrowed replacement, and an i32 passed twice.
- What you can do after
- Diagnose moved-value errors and choose between borrowing, returning ownership, copying, and cloning in function calls.
Read how Learn Rust in a Month of Lunches explains ownership →
Refactoring to Rust
The association in which a designated handle controls when a piece of memory is allocated and deallocated.
- How it is used
- Introduces ownership as a foundation for writing Rust and incrementally integrating it with existing applications.
- How deep it goes
- Defines single ownership and scope, then traces a move into a function and the resulting compiler error.
- Examples
- Uses an artwork catalog with a repeated function call and a manually managed welcome program to illustrate memory responsibility.
- What you can do after
- Diagnose ownership-related compiler errors by tracing which variable owns a value after a function call.
Rust in Action: Systems programming concepts and techniques
An owner is the binding or program entity responsible for cleaning up a value when its lifetime ends.
- How it is used
- Uses ownership to explain cleanup and safe access in Rust’s borrow-checking system.
- How deep it goes
- Explains moves, compiler-inserted cleanup, custom destructors, and strategies for resolving ownership errors.
- Examples
- Traces satellite status checks that move and return a CubeSat, and contrasts owned String with borrowed &str.
- What you can do after
- Diagnose ownership errors and choose among borrowing, duplication, returning ownership, or refactoring.
Read how Rust in Action: Systems programming concepts and techniques explains ownership →
Rust Web Development
Rust's ownership system governs how values are owned, borrowed, and dropped to ensure memory safety.
- How it is used
- Supports writing Rust code and interpreting compiler errors while building a web service.
- How deep it goes
- Works through assignment, function arguments, and mutable borrowing, with a brief explanation of moved values and compiler errors.
- Examples
- Uses String and &str assignments, a postal-address function, and a Warp store filter.
- What you can do after
- Diagnose moved-value errors and apply borrowing when a function should not take ownership.
Rust Servers, Services, and Apps
An ownership model assigns each value a responsible owner and determines when that value may be accessed or destroyed.
- How it is used
- Frames Rust resource management around explicit ownership, borrowing, and compile-time memory safety.
- How deep it goes
- Explains ownership transfer, scope-based destruction, reference types, and borrow-checking constraints, without implementation internals.
- Examples
- Uses ownership transfer, scope exit, immutable references, and mutable references as concrete rule examples.
- What you can do after
- Apply Rust ownership and borrowing rules while understanding the compiler guarantees against invalid memory access.
Read how Rust Servers, Services, and Apps explains ownership →
Digital Twins in Action
Ownership is the assignment of responsibility and authority for the operation, maintenance, and outcomes of a system or capability.
- How it is used
- Assigns accountability and decision authority across digital twin components and data sources.
- How deep it goes
- Identifies layers requiring named owners and explains conflict resolution and failure risks, without prescribing an ownership assignment procedure.
- Examples
- Contrasts a home twin’s individually owned sources with an industrial asset receiving conflicting data from contractors, vendors, and internal teams.
- What you can do after
- Evaluate ownership gaps across twin layers and identify where authority is needed to resolve conflicting source data.
Systems Programming with Zig
Memory ownership is the responsibility for managing the lifetime and eventual release of allocated memory.
- How it is used
- Manages input-string lifetimes when creating recipes in a recipe book.
- How deep it goes
- Explains uncopied input strings, outliving memory, dangling pointers, and arena-based duplication.
- Examples
- Contrasts passing long-lived recipe strings with duplicating C strings into a string arena.
- What you can do after
- Apply lifetime choices by passing strings that outlive a recipe or duplicating them into its string arena.
Introduction to Generative AI, Second Edition
Ownership is the legally recognized control or entitlement associated with property or rights in a creative work.
- How it is used
- Frames ownership as a central governance question for generative media and the creative economy.
- How deep it goes
- Connects ownership to copyright, authorship, consent, compensation, attribution, and creative control without resolving their legal boundaries.
- Examples
- Uses prompt-generated songs from Suno and Udio alongside concerns about unauthorized artist work.
- What you can do after
- Evaluate ownership disputes by separating control, benefits, attribution, authorization, and consent.
Read how Introduction to Generative AI, Second Edition explains ownership →
Also covered in
- API Design Patterns
- Code Like a Pro in Rust
- Embedded Software with RustIn early access (MEAP)
- Write Powerful Rust Macros
- Machine Learning System Design
- Architecture Modernization: Socio-technical alignment of software, strategy, and structure
- Authorization in Action
- Idiomatic Rust
What to know first
- RustRust is a statically typed systems programming language designed for performance, concurrency, and memory safety without requiring garbage collection.
- garbage collectionGarbage collection is an automated process that identifies and reclaims or removes memory, data, or other items no longer reachable or needed by a system.
- stringA string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
- C++C++ is a statically typed, general-purpose programming language that supports procedural, object-oriented, generic, and low-level systems programming.
Related concepts
- moveused by · Move semantics are language rules that transfer a value or its resources to another binding or object without copying them, potentially making the original binding unavailable.
- Rustpart of · Rust is a statically typed systems programming language designed for performance, concurrency, and memory safety without requiring garbage collection.
- borrow checkerused by · A borrow checker is a compiler component that statically enforces ownership, borrowing, and reference-lifetime rules to prevent invalid memory access.
- borrowingalternative to · Borrowing is Rust’s mechanism for accessing a value through a reference without transferring ownership, subject to rules governing reference validity and aliasing.
- business ruleconfigures · A business rule is a domain-specific constraint, policy, or decision criterion that governs valid data, behavior, decisions, or processes.
Questions about ownership
What is ownership?
Ownership is a programming-language model that assigns responsibility for a value or resource and governs its access, lifetime, and eventual cleanup.
Which Manning books explain ownership?
Learn Rust in a Month of Lunches, Refactoring to Rust, Rust in Action: Systems programming concepts and techniques, Rust Web Development, Rust Servers, Services, and Apps, Digital Twins in Action, Systems Programming with Zig and Introduction to Generative AI, Second Edition.
What should I know before learning ownership?
Manning books that teach ownership usually introduce Rust, garbage collection, string and C++ first.
What is the difference between ownership and borrowing?
Ownership is a programming-language model that assigns responsibility for a value or resource and governs its access, lifetime, and eventual cleanup. Borrowing is Rust’s mechanism for accessing a value through a reference without transferring ownership, subject to rules governing reference validity and aliasing.
What kinds of ownership are there?
Kinds of ownership include shared ownership.
What is ownership part of?
Ownership is part of Rust. Rust is a statically typed systems programming language designed for performance, concurrency, and memory safety without requiring garbage collection.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







