querio 0.0.1

Struct based string builder
Documentation
  • Coverage
  • 35.29%
    6 out of 17 items documented0 out of 9 items with examples
  • Size
  • Source code size: 22.68 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.72 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dekirisu/querio
    2 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dekirisu

Struct based string builder

🐠 add querio to the dependencies in the Cargo.toml:

[dependencies]

querio = "0.0.1"

🦀 use/import everything into rust:

use querio::*;

🦊 build the string:

// runtime variables
#[derive(Strung,Intuple)]
struct VarStruct {
    numb: u32,
    strg: &'static str
}

// create builder
#[derive(Querio)]
#[querio(
    // attach runtime variables, address with #{field_name}
    variables(VarStruct), 

    // add compile time variables, address with <index>
    sections("Test1","Test2"), 

    // the string those variables will be merged in
    "#numb #strg <0> <1> <0>"
)] struct ABuilder {}

fn main(){
    // use the builder with attached variables struct
    let text = ABuilder::querio(&VarStruct{numb:10,strg:"RT"}); 
    // => "10 RT Test1 Test2 Test1"
        
    // OR use the variable structs tuple representation and ::qrio(..)
    let text = ABuilder::qrio((10,"RT"));
    // => "10 RT Test1 Test2 Test1"
}

License