GithubHelp home page GithubHelp logo

cddl-cat's People

Contributors

ericseppanen avatar ktorz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cddl-cat's Issues

Allow streaming deserialization?

Some extended thoughts on deserialization:

I have been toying with the idea of doing "streaming" style validation: instead of deserializing the entire data structure before validation, only deserialize the fields that are immediately needed to perform the next "step" of validation. For maps, this would not change anything, but in some cases it would make the validation use a lot less memory. And the validation-failure path could short-circuit (returning without deserializing the rest of the data).

I built the cbor_tools crate as a debugging tool, but something based on that might allow me to do streaming validation of CBOR. It would also allow some additional additional strict checks like "CDDL says f32, but the value is a CBOR f64"; that level of detail is currently lost during deserialization.

Optimizing the validation-failure path is probably not the best use of time; there are probably better things to spend my time on.
Also, I'm not sure if it would be possible to do streaming validation of JSON and I like the fact that both JSON and CBOR share the same validation code.

Master !== Crates.io

My repo compiles fine when i link to this repo via git... However when i try and pull from crates-io i get this error below.

crates-io advertises v0.6.1, and this master repo also advertises v0.6.1. but i suspect they are out of sync. Can you publish v0.6.2 perhaps?

error[E0277]: the trait bound `cddl_cat::parser::ParseError: std::cmp::Eq` is not satisfied
   --> src/util.rs:6:11
    |
4   | #[derive(Debug, PartialEq, Eq)]
    |                            -- in this derive macro expansion
5   | pub enum ValidateError {
6   |     Parse(ParseError),
    |           ^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `cddl_cat::parser::ParseError`
    |
note: required by a bound in `AssertParamIsEq`
   --> /home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:313:31
    |
313 | pub struct AssertParamIsEq<T: Eq + ?Sized> {
    |                               ^^ required by this bound in `AssertParamIsEq`
    = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
    ```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.