pub struct AsyncApiRule {
pub endpoint: String,
pub message: Option<String>,
}Expand description
External API validation rule.
Validates a value against an external API endpoint.
Fields§
§endpoint: StringAPI endpoint URL
message: Option<String>Custom error message
Implementations§
Trait Implementations§
Source§impl AsyncValidationRule<String> for AsyncApiRule
impl AsyncValidationRule<String> for AsyncApiRule
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 AsyncApiRule
impl AsyncValidationRule<str> for AsyncApiRule
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 AsyncApiRule
impl Clone for AsyncApiRule
Source§fn clone(&self) -> AsyncApiRule
fn clone(&self) -> AsyncApiRule
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 AsyncApiRule
impl Debug for AsyncApiRule
Source§impl<'de> Deserialize<'de> for AsyncApiRule
impl<'de> Deserialize<'de> for AsyncApiRule
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<AsyncApiRule> for SerializableRule
impl From<AsyncApiRule> for SerializableRule
Source§fn from(rule: AsyncApiRule) -> Self
fn from(rule: AsyncApiRule) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AsyncApiRule
impl PartialEq for AsyncApiRule
Source§impl Serialize for AsyncApiRule
impl Serialize for AsyncApiRule
impl StructuralPartialEq for AsyncApiRule
Auto Trait Implementations§
impl Freeze for AsyncApiRule
impl RefUnwindSafe for AsyncApiRule
impl Send for AsyncApiRule
impl Sync for AsyncApiRule
impl Unpin for AsyncApiRule
impl UnwindSafe for AsyncApiRule
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