Skip to content

Commit ed245dd

Browse files
committed
fix README, add license tags
Signed-off-by: Dave Huseby <[email protected]>
1 parent b632ea9 commit ed245dd

File tree

6 files changed

+29
-1
lines changed

6 files changed

+29
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1+
[![](https://img.shields.io/badge/made%20by-Cryptid%20Technologies-gold.svg?style=flat-square)][CRYPTID]
2+
[![](https://img.shields.io/badge/project-provenance-purple.svg?style=flat-square)][PROVENANCE]
3+
[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)][MULTIFORMATS]
4+
![](https://github.com/cryptidtech/multitrait/actions/workflows/rust.yml/badge.svg)
5+
16
# Multitrait
2-
Helpful traits and functions common to multicodec types.
7+
8+
This crate contains three helpful traits common to most/all multiformats
9+
objects:
10+
11+
**`EncodeInto`**
12+
: Defines a single function for encoding a value into a `Vec<u8>`
13+
14+
**`TryDecodeFrom`**
15+
: Defines a simple interface for fallibly decoding a value from a `&[u8]` while
16+
tracking which bytes have been consumed.
17+
18+
**`Null`**
19+
: Defines two functions for creating a "null" multiformats value and for
20+
testing if a multiformats value is the null value. This allows for the
21+
definition of a "null" CID or a "null" VLAD or even a "null" Multisig.
22+
23+
[CRYPTID]: https://cryptid.tech/
24+
[PROVENANCE]: https://github.com/cryptidtech/provenance-specifications/
25+
[MULTIFORMATS]: https://github.com/multiformats/multiformats/

src/enc_into.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Idnetifier: Apache-2.0
12
use unsigned_varint::{decode, encode};
23

34
/// This trait encodes a numeric value into a compact varuint Vec<u8>

src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Idnetifier: Apache-2.0
12
/// Errors generated by the numeric type impls
23
#[derive(Clone, Debug, thiserror::Error)]
34
#[non_exhaustive]

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Idnetifier: Apache-2.0
12
//! # Multiutil
23
//!
34
//! A set of traits that are helpful for implementing

src/null.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Idnetifier: Apache-2.0
12
/// This trait is for multiformat objects that have a NULL value
23
pub trait Null {
34
/// return an instance of Self where is_null(&self) -> true

src/try_decode_from.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Idnetifier: Apache-2.0
12
use crate::Error;
23
use unsigned_varint::decode;
34

0 commit comments

Comments
 (0)