Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Copying memory - Introduction

// Copyright 2026 Google LLC
// SPDX-License-Identifier: Apache-2.0

/// Reads bytes from `source` and writes them to `dest`
pub fn copy(dest: &mut [u8], source: &[u8]) { ... }
This slide and its sub-slides should take about 28 minutes.

β€œHere is our initial function prototype.”

β€œcopy accepts two slices as arguments. dest (destination) is mutable, whereas source is not.”

β€œLet’s see the shapes of sound Rust code.”