MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / Dictionary

Interface Dictionary

Source Code/19-30.rs:4–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20, 1; None, Some(“Jane”)*/
3fn main() {
4 trait Dictionary { //1
5 type Key; //2
6 type Count; //3
7 fn get(&self, key: Self::Key) -> Option<String>; //4
8 fn count(&self, key: Self::Key) -> Self::Count; //5
9 }
10 struct Record {
11 id: u32,
12 name: String,

Callers

nothing calls this directly

Implementers 1

mainSource Code/19-30.rs

Calls

no outgoing calls

Tested by

no test coverage detected