pub enum GreaterThan {
Gt(u32),
Gte(u32),
}
Variants§
Gt(u32)
gt
requires the field value to be greater than the specified value
(exclusive). If the value of gt
is larger than a specified lt
or
lte
, the range is reversed, and the field value must be outside the
specified range. If the field value doesn’t meet the required conditions,
an error message is generated.
message MyFixed32 {
// value must be greater than 5 \[fixed32.gt\]
fixed32 value = 1 \[(buf.validate.field).fixed32.gt = 5\];
// value must be greater than 5 and less than 10 \[fixed32.gt_lt\]
fixed32 other_value = 2 \[(buf.validate.field).fixed32 = { gt: 5, lt: 10 }\];
// value must be greater than 10 or less than 5 \[fixed32.gt_lt_exclusive\]
fixed32 another_value = 3 \[(buf.validate.field).fixed32 = { gt: 10, lt: 5 }\];
}
Gte(u32)
gte
requires the field value to be greater than or equal to the specified
value (exclusive). If the value of gte
is larger than a specified lt
or lte
, the range is reversed, and the field value must be outside the
specified range. If the field value doesn’t meet the required conditions,
an error message is generated.
message MyFixed32 {
// value must be greater than or equal to 5 \[fixed32.gte\]
fixed32 value = 1 \[(buf.validate.field).fixed32.gte = 5\];
// value must be greater than or equal to 5 and less than 10 \[fixed32.gte_lt\]
fixed32 other_value = 2 \[(buf.validate.field).fixed32 = { gte: 5, lt: 10 }\];
// value must be greater than or equal to 10 or less than 5 \[fixed32.gte_lt_exclusive\]
fixed32 another_value = 3 \[(buf.validate.field).fixed32 = { gte: 10, lt: 5 }\];
}
Implementations§
Source§impl GreaterThan
impl GreaterThan
Sourcepub fn merge(
field: &mut Option<GreaterThan>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<GreaterThan>, 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§
Source§impl Clone for GreaterThan
impl Clone for GreaterThan
Source§fn clone(&self) -> GreaterThan
fn clone(&self) -> GreaterThan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GreaterThan
impl Debug for GreaterThan
Source§impl PartialEq for GreaterThan
impl PartialEq for GreaterThan
impl Copy for GreaterThan
impl StructuralPartialEq for GreaterThan
Auto Trait Implementations§
impl Freeze for GreaterThan
impl RefUnwindSafe for GreaterThan
impl Send for GreaterThan
impl Sync for GreaterThan
impl Unpin for GreaterThan
impl UnwindSafe for GreaterThan
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