string

Macro string 

Source
macro_rules! string {
    (repeated $name:expr, $validator:expr) => { ... };
    (repeated $name:expr) => { ... };
    (optional $name:expr, $validator:expr) => { ... };
    (optional $name:expr) => { ... };
    ($name:expr, $validator:expr) => { ... };
    ($name:expr) => { ... };
}
Expand description

Evaluates to a protobuf string FieldBuilder instance.

The first argument is the name of the field, which can be a literal or an expression, optionally preceded by ‘optional’ or ‘repeated’.

The second, optional argument is a closure where validation rules can be defined.

If the field is marked as repeated, the closure will receive two arguments, one being the RepeatedValidator builder, and the other being the validator builder for the field. Otherwise, the only argument will be the latter.