Struct Range

Source
pub struct Range<T, Num> { /* private fields */ }
Available on crate feature full only.

Implementations§

Source§

impl<T, Num> Range<T, Num>

Source

pub fn new(value: T) -> Self

Trait Implementations§

Source§

impl<T: Clone, Num: Clone> Clone for Range<T, Num>

Source§

fn clone(&self) -> Range<T, Num>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, Num> Debug for Range<T, Num>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Rule for Range<T, char>
where T: RangeBounds<char> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, f32>
where T: RangeBounds<f32> + Clone + 'static,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, f64>
where T: RangeBounds<f64> + Clone + 'static,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, i16>
where T: RangeBounds<i16> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, i32>
where T: RangeBounds<i32> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, i64>
where T: RangeBounds<i64> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, i8>
where T: RangeBounds<i8> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, u16>
where T: RangeBounds<u16> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, u32>
where T: RangeBounds<u32> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, u64>
where T: RangeBounds<u64> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T> Rule for Range<T, u8>
where T: RangeBounds<u8> + Clone,

Source§

const NAME: &'static str = NAME

Named rule type, used to distinguish different rules Read more
Source§

type Message = Message

custom define returning message type
Source§

fn message(&self) -> Self::Message

Default rule error message, when validate fails, return the message to user
Source§

fn call(&mut self, data: &mut Value) -> bool

Rule specific implementation, data is current field’s value
Source§

fn call_with_relate(&mut self, data: &mut ValueMap) -> bool

Rule specific implementation, data is gived type all field’s value, and current field index. when the method return true, call_message will return Ok(()), or else return Err(String) Read more
Source§

impl<T: Copy, Num: Clone> Copy for Range<T, Num>

Auto Trait Implementations§

§

impl<T, Num> Freeze for Range<T, Num>
where T: Freeze,

§

impl<T, Num> RefUnwindSafe for Range<T, Num>

§

impl<T, Num> Send for Range<T, Num>
where T: Send, Num: Send,

§

impl<T, Num> Sync for Range<T, Num>
where T: Sync, Num: Sync,

§

impl<T, Num> Unpin for Range<T, Num>
where T: Unpin, Num: Unpin,

§

impl<T, Num> UnwindSafe for Range<T, Num>
where T: UnwindSafe, Num: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CoreRule<ValueMap, ()> for T
where T: Rule + 'static + Clone,

Source§

fn call( &mut self, data: &mut ValueMap, ) -> Result<(), <T as CoreRule<ValueMap, ()>>::Message>

Rule specific implementation, data is gived type all field’s value, and current field index.

Source§

const THE_NAME: &'static str = const THE_NAME: &'static str = T::NAME;

Named rule type, used to distinguish between different rules. Read more
Source§

type Message = <T as Rule>::Message

custom define returning message type
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<R, M> IntoRuleList<ValueMap, M> for R
where R: CoreRule<ValueMap, (), Message = M>, M: 'static,

Source§

impl<R, Input, Msg> RuleExt<Input, Msg> for R
where R: CoreRule<Input, (), Message = Msg>, Msg: 'static,

Source§

fn and<R2>(self, other: R2) -> RuleList<Input, Msg>
where R2: CoreRule<Input, (), Message = Msg>,

Source§

fn custom<F, V>(self, other: F) -> RuleList<Input, Msg>
where F: for<'a> FnOnce(&'a mut V) -> Result<(), Msg> + CoreRule<Input, V, Message = Msg>, V: FromValue + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,