pub struct AsyncExistsRule {
pub table: String,
pub column: String,
pub message: Option<String>,
}Expand description
Database existence validation rule.
Validates that a value exists in a database table column.
Fields§
§table: StringDatabase table name
column: StringColumn name to check
message: Option<String>Custom error message
Implementations§
Trait Implementations§
Source§impl AsyncValidationRule<String> for AsyncExistsRule
impl AsyncValidationRule<String> for AsyncExistsRule
Source§fn validate_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 String,
ctx: &'life2 ValidationContext,
) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 String,
ctx: &'life2 ValidationContext,
) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate the value asynchronously.
Source§fn default_message(&self) -> String
fn default_message(&self) -> String
Get the default error message for this rule.
Source§impl AsyncValidationRule<str> for AsyncExistsRule
impl AsyncValidationRule<str> for AsyncExistsRule
Source§fn validate_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 str,
ctx: &'life2 ValidationContext,
) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate_async<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 str,
ctx: &'life2 ValidationContext,
) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate the value asynchronously.
Source§fn default_message(&self) -> String
fn default_message(&self) -> String
Get the default error message for this rule.
Source§impl Clone for AsyncExistsRule
impl Clone for AsyncExistsRule
Source§fn clone(&self) -> AsyncExistsRule
fn clone(&self) -> AsyncExistsRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AsyncExistsRule
impl Debug for AsyncExistsRule
Source§impl<'de> Deserialize<'de> for AsyncExistsRule
impl<'de> Deserialize<'de> for AsyncExistsRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AsyncExistsRule> for SerializableRule
impl From<AsyncExistsRule> for SerializableRule
Source§fn from(rule: AsyncExistsRule) -> Self
fn from(rule: AsyncExistsRule) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AsyncExistsRule
impl PartialEq for AsyncExistsRule
Source§impl Serialize for AsyncExistsRule
impl Serialize for AsyncExistsRule
impl StructuralPartialEq for AsyncExistsRule
Auto Trait Implementations§
impl Freeze for AsyncExistsRule
impl RefUnwindSafe for AsyncExistsRule
impl Send for AsyncExistsRule
impl Sync for AsyncExistsRule
impl Unpin for AsyncExistsRule
impl UnwindSafe for AsyncExistsRule
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