pub enum WellKnown {
    Email(bool),
    Hostname(bool),
    Ip(bool),
    Ipv4(bool),
    Ipv6(bool),
    Uri(bool),
    UriRef(bool),
    Address(bool),
    Uuid(bool),
    WellKnownRegex(i32),
}
Expand description

WellKnown rules provide advanced constraints against common string patterns

Variants

Email(bool)

Email specifies that the field must be a valid email address as defined by RFC 5322

Hostname(bool)

Hostname specifies that the field must be a valid hostname as defined by RFC 1034. This constraint does not support internationalized domain names (IDNs).

Ip(bool)

Ip specifies that the field must be a valid IP (v4 or v6) address. Valid IPv6 addresses should not include surrounding square brackets.

Ipv4(bool)

Ipv4 specifies that the field must be a valid IPv4 address.

Ipv6(bool)

Ipv6 specifies that the field must be a valid IPv6 address. Valid IPv6 addresses should not include surrounding square brackets.

Uri(bool)

Uri specifies that the field must be a valid, absolute URI as defined by RFC 3986

UriRef(bool)

UriRef specifies that the field must be a valid URI as defined by RFC 3986 and may be relative or absolute.

Address(bool)

Address specifies that the field must be either a valid hostname as defined by RFC 1034 (which does not support internationalized domain names or IDNs), or it can be a valid IP (v4 or v6).

Uuid(bool)

Uuid specifies that the field must be a valid UUID as defined by RFC 4122

WellKnownRegex(i32)

WellKnownRegex specifies a common well known pattern defined as a regex.

Implementations

Encodes the message to a buffer.

Decodes an instance of the message from a buffer, and merges it into self.

Returns the encoded length of the message without a length delimiter.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more