colonbuilder

Crates.iocolonbuilder
lib.rscolonbuilder
version0.1.6
sourcesrc
created_at2023-02-25 12:39:57.247588
updated_at2023-02-26 01:16:35.208189
descriptionA rust builder offers from_str method to build struct from colon separate string.
homepage
repositoryhttps://github.com/Celthi/ColonBuilder.git
max_upload_size
id794320
size15,522
Evan Lu (Celthi)

documentation

README

Colon Builder

build status

Build structure from colon separate fields like

name:colon builder
hobbies: book,game,football
TV: once a while

Sample code

#[derive(ColonBuilder)]
struct Person {
    #[cb(require)]
    name: String,
    hobbies: Vec<String>,
    #[cb(abbr="TV")]
    favoriteTVShows: Option<String>
}

let p = Person::from_str("name:lu\nTV:show");

cargo expand --test test_builder to expand the test file test_builder.rs

Commit count: 16

cargo fmt