4 Traits To invoke a trait method, two things must be true:
The type must implement the trait. The trait must be in scope. To satisfy the latter, you may have to add a use statement for the trait:
use crate::MaybeZero; This is not necessary if:
The trait is defined in the same module where the invocation occurs. The trait is defined in the standard library’s prelude. The prelude is a set of traits and types that are automatically imported into every Rust program. It’s as if use std::prelude::*; was added at the beginning of every Rust module. Orphan Rule When a type is defined in another crate (e.g. u32, from Rust’s standard library), you can’t directly define new methods for it.
...