File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed
Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " multitrait"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44edition = " 2021"
55authors = [
" Dave Huseby <[email protected] >" ]
66description = " Multiformat traits"
@@ -9,5 +9,7 @@ readme = "README.md"
99license = " Apache-2.0"
1010
1111[dependencies ]
12+ multibase = " 0.9"
13+ multicodec = { version = " 0.2" , git = " https://github.com/cryptidtech/rust-multicodec.git" }
1214thiserror = " 1.0"
1315unsigned-varint = { version = " 0.8" , features = [" std" ] }
Original file line number Diff line number Diff line change 1+ use crate :: prelude:: Codec ;
2+
3+ /// This trait exposes the codec information for multicoded types
4+ pub trait CodecInfo {
5+ /// return the preferred codec associated with this object
6+ fn preferred_codec ( ) -> Codec ;
7+
8+ /// return the actual codec associated with this object
9+ fn codec ( & self ) -> Codec ;
10+ }
Original file line number Diff line number Diff line change 1+ use crate :: prelude:: Base ;
2+
3+ /// This trait exposes the preferred encoding for this multicodec type
4+ pub trait EncodingInfo {
5+ /// return the preferred encoding for this multicodec type
6+ fn preferred_encoding ( ) -> Base ;
7+
8+ /// return the actual encoding for this multicodec type
9+ fn encoding ( & self ) -> Base ;
10+ }
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ pub mod try_decode_from;
2020/// one-stop shop for all exported symbols
2121pub mod prelude {
2222 pub use super :: { enc_into:: * , try_decode_from:: * } ;
23+
24+ /// re-exports
25+ pub use multibase:: Base ;
26+ pub use multicodec:: prelude:: Codec ;
2327}
2428
2529#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments