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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:

env:
JS_PACKAGES: "['type-length-value-js']"
SBPF_PROGRAM_PACKAGES: "['discriminator', 'generic-token', 'list-view', 'pod', 'program-error', 'tlv-account-resolution', 'type-length-value']"
RUST_PACKAGES: "['discriminator', 'discriminator-derive', 'discriminator-syn', 'generic-token', 'generic-token-tests', 'list-view', 'pod', 'program-error', 'program-error-derive', 'tlv-account-resolution', 'type-length-value', 'type-length-value-derive', 'type-length-value-derive-test']"
WASM_PACKAGES: "['discriminator', 'generic-token', 'list-view', 'pod', 'program-error', 'tlv-account-resolution', 'type-length-value']"
SBPF_PROGRAM_PACKAGES: "['collections', 'discriminator', 'generic-token', 'list-view', 'pod', 'program-error', 'tlv-account-resolution', 'type-length-value']"
RUST_PACKAGES: "['collections', 'discriminator', 'discriminator-derive', 'discriminator-syn', 'generic-token', 'generic-token-tests', 'list-view', 'pod', 'program-error', 'program-error-derive', 'tlv-account-resolution', 'type-length-value', 'type-length-value-derive', 'type-length-value-derive-test']"
WASM_PACKAGES: "['collections', 'discriminator', 'generic-token', 'list-view', 'pod', 'program-error', 'tlv-account-resolution', 'type-length-value']"

jobs:
set_env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
default: 'discriminator'
type: choice
options:
- collections
- discriminator
- discriminator-derive
- discriminator-syn
Expand Down
9 changes: 9 additions & 0 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
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"collections",
"discriminator",
"discriminator-derive",
"discriminator-syn",
Expand Down
27 changes: 27 additions & 0 deletions collections/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "spl-collections"
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're good with the name, let's reserve it on crates.io!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lorisleiva has another suggestion: solana-wire-types

Copy link
Contributor

Choose a reason for hiding this comment

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

that would confuse with networking types though, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, let's keep it collections then.

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]
borsh = ["dep:borsh"]
wincode = ["dep:wincode"]

[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"]
16 changes: 16 additions & 0 deletions collections/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! 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))]

extern crate alloc;

mod str;
mod vec;

pub use str::*;
pub use vec::*;
Loading
Loading