liveBook · Manning

Dynamically sized type

A dynamically sized type is a type whose size is not known at compile time and requires runtime size information.

How 2 Manning books explain it

Rust in Action: Systems programming concepts and techniques

A dynamically sized type is a type whose size is not known at compile time and whose values require runtime size information.

How it is used
Introduces dynamically sized types while explaining heap memory and references.
How deep it goes
Defines dynamically sized types and explains slice references, while mentioning trait objects without developing them.
Examples
Uses slices of arrays and contrasts them with String and Vec<T>, whose contents can grow or shrink.
What you can do after
Evaluate whether an unknown compile-time size necessarily means a value changes size at runtime.

Read how Rust in Action: Systems programming concepts and techniques explains dynamically sized type →

Learn Rust in a Month of Lunches

A dynamically sized type is a type whose size is not known at compile time and may vary between values.

How it is used
Explains why Rust represents variable-length text through references such as &str or owned values such as String.
How deep it goes
Defines dynamic sizing, measures concrete values, and follows an invalid str declaration through compiler feedback to a borrowing fix.
Examples
Uses multilingual names, an emoji, memory-size functions, and an invalid str variable corrected to &str.
What you can do after
Apply via Rust syntax by choosing &str for borrowed text, String for owned text, and size_of_val for value measurements.

Read how Learn Rust in a Month of Lunches explains dynamically sized type →

Related concepts

Questions about dynamically sized type

What is dynamically sized type?

A dynamically sized type is a type whose size is not known at compile time and requires runtime size information.

Which Manning books explain dynamically sized type?

Rust in Action: Systems programming concepts and techniques and Learn Rust in a Month of Lunches.

What kinds of dynamically sized type are there?

Kinds of dynamically sized type include slicing.

What is dynamically sized type a kind of?

Dynamically sized type is a kind of type. type is Zig's compile-time type whose values represent types themselves.

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.