AsyncCreateWithAndValidate

Trait AsyncCreateWithAndValidate 

Source
pub trait AsyncCreateWithAndValidate<X>:
    Sized
    + AsyncTryFrom<X>
    + ValidateIntegrity<Error = Self::Error>
where X: for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,
{ // Provided method fn new_and_validate<'life0, 'async_trait>( input: &'life0 X, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Send + 'async_trait { ... } }
Expand description

Trait that combines async creation with integrity validation

Provided Methods§

Source

fn new_and_validate<'life0, 'async_trait>( input: &'life0 X, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Send + 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<X, T> AsyncCreateWithAndValidate<X> for T
where X: for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, T: AsyncTryFrom<X> + ValidateIntegrity<Error = <T as AsyncTryFrom<X>>::Error>,