pub enum WellKnown {
Ip(bool),
Ipv4(bool),
Ipv6(bool),
}
Expand description
WellKnown rules provide advanced constraints against common byte patterns
Variants§
Ip(bool)
Ip specifies that the field must be a valid IP (v4 or v6) address in byte format
Ipv4(bool)
Ipv4 specifies that the field must be a valid IPv4 address in byte format
Ipv6(bool)
Ipv6 specifies that the field must be a valid IPv6 address in byte format
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
Mutably borrows from an owned value. Read more