Skip to main content

MigrationContextValidator

Trait MigrationContextValidator 

Source
pub trait MigrationContextValidator {
    // Required methods
    fn validate(&self, context: RHashMap<RString, RString>) -> RResult<(), ()>;
    fn validate_parameter(
        &self,
        name: RString,
        value: RString,
    ) -> RResult<(), ()>;
}
Expand description

Migration context validator stable trait.

The reason for the existence of this trait is that abi_stable crate doesn’t support closures.

Required Methods§

Source

fn validate(&self, context: RHashMap<RString, RString>) -> RResult<(), ()>

Validate the whole plugin migration context.

§Idempotency

WARNING This callback may be called several times in a row. It is the responsibility of the plugin author to make this function idempotent.

Source

fn validate_parameter(&self, name: RString, value: RString) -> RResult<(), ()>

Validate a single parameter value from the migration context.

§Idempotency

WARNING This callback may be called several times in a row. It is the responsibility of the plugin author to make this function idempotent.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'lt, _ErasedPtr> MigrationContextValidator for MigrationContextValidator_TO<'lt, _ErasedPtr>
where Self:, _ErasedPtr: AsPtr<PtrTarget = ()>,