MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / _get_all_keys

Method _get_all_keys

chain/src/storage.rs:57–66  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

55 }
56
57 pub(crate) fn _get_all_keys<K: AsRef<[u8]>>(&self) -> Result<Vec<Box<[u8]>>> {
58 let value: Vec<Box<[u8]>> = self
59 .db
60 .iterator(rocksdb::IteratorMode::Start)
61 .map(std::result::Result::unwrap)
62 .map(|(key, _)| key)
63 .collect();
64
65 Ok(value)
66 }
67
68 pub(crate) fn _destroy(database_name: Option<&str>) -> Result<()> {
69 let database_name = database_name.unwrap_or(DATABASE_NAME);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected