Better HN
topnewbestaskshowjobs
Log inSign up

tu6ge

2 karma · joined Sep 25, 2023 (3y ago) · 7 submissions

Submissions

comment 7mo ago · link · parent

My design goal is to create a framework. Currently, I have briefly tried out the extensibility of the executor and I think it can handle the task of customizing shaders

comment 7mo ago · link · parent

Well, I put a video on the README showing draging to connect port

3.

Show HN: I developed a node editor framework using gpui(github.com ↗)

4 points · by tu6ge · 7mo ago · 4 comments

4.

Show HN: An unstyled, flexible form validation library for Vue 3(github.com ↗)

3 points · by tu6ge · 1y ago · discuss

comment 3y ago · link · parent

Valitron is an ergonomics, functional and configurable validator

## Features

- Ergonomics validation - Build-in rule, e.g. Required, StartWith ... - Closure validate - Related validate, e.g. password confirm - Custom rule with other parameter - Check / modify input data - Custom error message type - Support different error types convert, it can use both build-in rules and custom error type simultaneously - Collect validate error messages - Support all types data on `#[derive(Serialize, Deserialize)]` ( visit [`serde`](https://serde.rs/) for more info)

## Examples

```rust fn main() { let validator = Validator::new() .rule("name", Required.and(StartWith("hello"))) .rule("age", custom(age_limit)) .message([ ("name.required", "name is required"), ("name.start_with", "name should be starts with `hello`"), ]);

    let person = Person {
        name: "li",
        age: 18,
    };

    let res = validator.validate(person);
    // or using trait
    let res = person.validate(validator);
}

fn age_limit(n: &mut u8) -> Result<(), Message> { if n >= 25 && n <= 45 { return Ok(()); } Err("age should be between 25 and 45".into()) } ```

6.

Next Validator of Rust–Valitron(github.com ↗)

2 points · by tu6ge · 3y ago · 1 comment