Skip to main content

AsyncValidatable

Trait AsyncValidatable 

Source
pub trait AsyncValidatable<Key>
where Key: 'static,
{ // Required method fn validate_future( &self, ) -> Pin<Box<dyn Future<Output = Result<(), ValidationErrors<Key>>>>>; // Provided method fn validate_future_or_empty( &self, ) -> Pin<Box<dyn Future<Output = ValidationErrors<Key>>>> { ... } }
Available on crate feature async only.
Expand description

An item that can be validated asynchronously.

See Validatable for the synchronous version.

Required Methods§

Source

fn validate_future( &self, ) -> Pin<Box<dyn Future<Output = Result<(), ValidationErrors<Key>>>>>

Creates a future that will validate this item. The future returns Ok(()) if no errors were encountered, and returns Err(ValidationErrors) if any errors were encountered.

Provided Methods§

Source

fn validate_future_or_empty( &self, ) -> Pin<Box<dyn Future<Output = ValidationErrors<Key>>>>

Creates a future that will validate this item. The future returns an empty ValidationErrors if no errors were encountered during validation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§