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§
Source§impl WellKnown
impl WellKnown
Sourcepub fn merge(
field: &mut Option<WellKnown>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<WellKnown>, tag: u32, wire_type: WireType, buf: &mut impl Buf, ctx: DecodeContext, ) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into self.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
impl Copy for WellKnown
impl StructuralPartialEq for WellKnown
Auto Trait Implementations§
impl Freeze for WellKnown
impl RefUnwindSafe for WellKnown
impl Send for WellKnown
impl Sync for WellKnown
impl Unpin for WellKnown
impl UnwindSafe for WellKnown
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request