Skip to content

Glossary: Rust in Practice

safe wrapper

Also written: safe wrappers

A normal function that checks the rule an unsafe operation needs, then does it, so callers can't misuse it. `last_price` checks for an empty list before calling `price_at`.

Where the book teaches it

Related terms

unsafe functionunsafe