Skip to content

Glossary: Software Design Patterns in Rust

Liskov substitution principle (LSP)

Also written: LSP, Liskov, Liskov substitution

The SOLID rule that a stand-in must work wherever the original works. In Rust, every type implementing a trait must keep the trait's promises, as a LockedCard that panics in `top_up` does not.

Where the book teaches it

Related terms

SOLIDTrait