Giter Site home page Giter Site logo

accord's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

accord's Issues

Makefile for testing accord + example crates

Right now, the only way to test both accord and its examples is to run cargo test in both the accord crate and the bundled example crates. Introducing a Makefile to handle testing could reduce this to a single stop of make test.

Email validator

I'm really not sure about this, since it's easy to make an email validator too restrictive so as to hit false on obscure but valid urls.

More complete examples

The only real examples right now focuses of use in a REST API setting. There should be examples showcasing other scenarios.

Range is supposed to be half-open

Range is defined in Rust as half-open: so 12..127 means “at least 12, and less than 127”. In your validators you’ve implemented it with incorrect semantics, treating it as an inclusive range, which is instead 12...127 (and experimental).

Auto-rules for structs?

If you're looking for an idea for something to do, I think it would be pretty cool if I could:

#[derive(AccordValidate)]
struct Account {
    #[accord_rule(length(1..64))]
    name: String,
    #[accord_rule(length(5..64), contains("@"), contains("."))]
    email: String,
    #[accord_rule(range(12..127))]
    age: i8,
}

And get an auto-impld Account::validate function. A similar thing like derive(AccordNew) or AccordBuilder seem like something that would also be nice so that it's impossible to even build invalid objects in the common case.

Provide an API for stable rust

Currently there's no timeline for stabilization of impl trait. What do you think about moving the current validators behind a nightly feature gate, and returning boxed closures when that feature is not enabled?

URL validator

I'm really not sure about this, since it's easy to make an URL validator too restrictive so as to hit false on obscure but valid urls.

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.