Crates.io | simple-selectors |
lib.rs | simple-selectors |
version | 0.1.0 |
source | src |
created_at | 2018-02-12 08:50:34.633159 |
updated_at | 2018-02-12 08:50:34.633159 |
description | A simple label selector syntax inspired (and mostly compatible) to k8s |
homepage | https://github.com/m0ppers/simple-selectors |
repository | https://github.com/m0ppers/simple-selectors |
max_upload_size | |
id | 50800 |
size | 21,135 |
k8s style selectors for rust.
<selector-syntax> ::= <requirement> | <requirement> "," <selector-syntax>
<requirement> ::= [!] KEY [ <set-based-restriction> | <exact-match-restriction> ]
<set-based-restriction> ::= "" | <inclusion-exclusion> <value-set>
<inclusion-exclusion> ::= <inclusion> | <exclusion>
<exclusion> ::= "notin"
<inclusion> ::= "in"
<value-set> ::= "(" <values> ")"
<values> ::= VALUE | VALUE "," <values>
<exact-match-restriction> ::= ["="|"=="|"!="] VALUE
*) This section has been copy pasted from https://github.com/blendlabs/go-selector (this is what this library is based upon)
let mut labels = LabelMap::new();
labels.insert("test", "test");
labels.insert("test1", "test");
let result = parse("test = test, test1 in (test)", &labels);
Both very welcome. This is my first public crate and I am just starting to learn rust. So non-idiomatic rust and beginner mistakes are to be expected in the code base. Please provide feedback and contributions so I can fix it :).