Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ group = "0.13.0"
hex = "0.4.3"
hmac = "0.12.1"
im = "15.1.0"
imbl = ">= 6.0.0, < 8.0.0" # agave needs v7 for perf, but sdk needs v6 for min rust version 1.81; change to "7.0.0" when sdk >= rust 1.85
indicatif = "0.18.4"
itertools = "0.12.1"
js-sys = "0.3.77"
Expand Down
1 change: 1 addition & 0 deletions frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ thiserror = { workspace = true }
# to avoid version skew and keep digest computation stable regardless of consumer dependencies.
bincode = "1.3.3"
im = { workspace = true, features = ["rayon", "serde"] }
imbl = { workspace = true, features = ["rayon", "serde"] }
memmap2 = { workspace = true }
# These dependencies are used only to back `frozen-abi` StableAbi API,
# to avoid version skew and keep digest computation stable regardless of consumer dependencies.
Expand Down
15 changes: 15 additions & 0 deletions frozen-abi/src/abi_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,21 @@ impl<
}
}

#[cfg(not(target_os = "solana"))]
impl<K, V, S, P> AbiExample for imbl::GenericHashMap<K, V, S, P>
where
Comment on lines +434 to +436
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imbl::HashMap is just a type alias for this struct with two of the generic params held fixed

K: Clone + Eq + std::hash::Hash + AbiExample,
V: Clone + AbiExample,
S: Clone + std::hash::BuildHasher + Default,
P: imbl::shared_ptr::SharedPointerKind,
{
fn example() -> Self {
let mut map = Self::default();
map.insert(K::example(), V::example());
map
}
}

impl<T: std::cmp::Ord + AbiExample, S: AbiExample> AbiExample for BTreeMap<T, S> {
fn example() -> Self {
println!("AbiExample for (BTreeMap<T, S>): {}", type_name::<Self>());
Expand Down