Dumb question #1: If a value/variable/object/'other name' is not owned, is it always borrowed?

From a practical point of view it may help to read the book's section on ownership. It uses the term value rather than object or instance, and relies on the user to be familiar with the common approach in programming languages where variables hold values. If this is familiar to you, ownership can be discussed in those terms.

1 Like

and what @kpreid means by value is a davo.

Yes — the things that actually exist in memory. All of your red text is information that is not stored in memory, but only exists either at compile time (e.g. struct field positions) or implicitly (e.g. slice elements).

And if I understand correctly a davo is always owned by a daio.

I think you might be interested in the concept Rust calls places. A place is roughly “a thing that could be assigned to” — a piece of memory with an address and a statically known type. I think that you can replace “daio” with “place” (and "davo" with "value") in your mental model to obtain standard Rust terminology.

2 Likes

Thanks, I'll learn the standard terms as well as keeping my own terms on the side.
It looks like @kpreid was using the correct term.

1 Like

I've got my terminology down now.

All nedos and codos are odos, that is to say owned data objects.
A primitive variable is a nedo, a non-primitive variables a codo.
Same with primitive and non-primitive members and array elements.

https://doc.rust-lang.org/book/ch05-01-defining-structs.html?highlight=instance

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.