-
Notifications
You must be signed in to change notification settings - Fork 17
Add collections crate #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| [package] | ||
| name = "spl-collections" | ||
| version = "0.0.0" | ||
| description = "Serialization-aware collection wrappers for Solana account data" | ||
| authors = ["Anza Maintainers <maintainers@anza.xyz>"] | ||
| repository = "https://github.com/solana-program/libraries" | ||
| license = "Apache-2.0" | ||
| edition = "2021" | ||
|
|
||
| [package.metadata.docs.rs] | ||
| targets = ["x86_64-unknown-linux-gnu"] | ||
| all-features = true | ||
| rustdoc-args = ["--cfg=docsrs"] | ||
|
|
||
| [features] | ||
| alloc = [] | ||
| borsh = ["dep:borsh", "alloc"] | ||
| default = ["alloc"] | ||
| wincode = ["dep:wincode", "alloc"] | ||
|
|
||
| [dependencies] | ||
| borsh = { version = "1.0", features = ["derive"], default-features = false, optional = true } | ||
| wincode = { version = "0.4.4", features = ["alloc", "derive"], default-features = false, optional = true } | ||
|
|
||
| [dev-dependencies] | ||
| spl-collections = { path = ".", features = ["borsh", "wincode"] } | ||
|
|
||
| [lib] | ||
| crate-type = ["lib"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| //! Serialization-aware collection wrappers for Solana account data. | ||
| //! | ||
| //! This crate provides wrappers around collection types to support custom serialization | ||
| //! logic. This is useful for programs that have specific requirements for how data is | ||
| //! stored. | ||
|
|
||
| #![no_std] | ||
| #![cfg_attr(docsrs, feature(doc_cfg))] | ||
|
|
||
| #[cfg(feature = "alloc")] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should depend on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine by me, we could even call the crate |
||
| extern crate alloc; | ||
|
|
||
| #[cfg(feature = "alloc")] | ||
| mod string; | ||
| #[cfg(feature = "alloc")] | ||
| mod vec; | ||
|
|
||
| #[cfg(feature = "alloc")] | ||
| pub use string::*; | ||
| #[cfg(feature = "alloc")] | ||
| pub use vec::*; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To go with these changes, can you include the new package at
libraries/.github/workflows/main.yml
Lines 11 to 13 in ed9d43b
libraries/.github/workflows/publish-rust.yml
Line 12 in ed9d43b