serde_cbor #1
24
.drone.yml
Normal file
24
.drone.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: fmt
|
||||||
|
image: rust:1.43.0
|
||||||
|
commands:
|
||||||
|
- rustup component add rustfmt
|
||||||
|
- cargo fmt --all -- --check
|
||||||
|
- name: test
|
||||||
|
image: rust:1.43.0
|
||||||
|
commands:
|
||||||
|
- cargo test --all-features
|
||||||
|
- name: publish
|
||||||
|
image: rust:1.43.0
|
||||||
|
environment:
|
||||||
|
CARGO_REGISTRY_TOKEN:
|
||||||
|
from_secret: cargo_tkn
|
||||||
|
commands:
|
||||||
|
- grep -E 'version ?= ?"${DRONE_TAG}"' -i Cargo.toml || (printf "incorrect crate/tag version" && exit 1)
|
||||||
|
- cargo package --all-features
|
||||||
|
- cargo publish --all-features
|
||||||
|
when:
|
||||||
|
event: tag
|
@ -23,6 +23,10 @@ rust-crypto = "0.2"
|
|||||||
csv-core = "0.1.6"
|
csv-core = "0.1.6"
|
||||||
derive_builder = "0.9.0"
|
derive_builder = "0.9.0"
|
||||||
crossbeam = { version = "0.7.3", optional = true }
|
crossbeam = { version = "0.7.3", optional = true }
|
||||||
|
serde_derive = "1.0.106"
|
||||||
|
serde = "1.0.106"
|
||||||
|
serde_cbor = "0.11.1"
|
||||||
|
serde_bytes = "0.11.3"
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
crossbeam = "0.7.3"
|
crossbeam = "0.7.3"
|
||||||
hex = "0.4.0"
|
hex = "0.4.0"
|
||||||
|
1279
src/protocol/cbor.rs
Normal file
1279
src/protocol/cbor.rs
Normal file
File diff suppressed because it is too large
Load Diff
7
src/protocol/error.rs
Normal file
7
src/protocol/error.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
|
pub enum ProtocolError {
|
||||||
|
CborEncode,
|
||||||
|
CborDecode { data: Vec<u8> },
|
||||||
|
}
|
4
src/protocol/mod.rs
Normal file
4
src/protocol/mod.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
mod cbor;
|
||||||
|
mod error;
|
||||||
|
pub use self::cbor::*;
|
||||||
|
pub use self::error::*;
|
9
src/transport/mod.rs
Normal file
9
src/transport/mod.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
use crate::protocol::{CborRequest, CborResponse};
|
||||||
|
|
||||||
|
pub trait CtapTransport {
|
||||||
|
type Error;
|
||||||
|
|
||||||
|
fn cbor<'a>(&mut self, command: &CborRequest<'a>) -> Result<CborResponse, Self::Error>;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum CtapCommand {}
|
Loading…
x
Reference in New Issue
Block a user