[][src]Trait exonum_supervisor::Configure

pub trait Configure {
    type Params: BinaryValue;
    fn verify_config(
        &self,
        context: CallContext,
        params: Self::Params
    ) -> Result<(), ExecutionError>;
fn apply_config(
        &self,
        context: CallContext,
        params: Self::Params
    ) -> Result<(), ExecutionError>; }

Describes a procedure for updating the configuration of a service instance.

Associated Types

type Params: BinaryValue

The specific type of parameters passed during the service instance configuration.

Loading content...

Required methods

fn verify_config(
    &self,
    context: CallContext,
    params: Self::Params
) -> Result<(), ExecutionError>

Verify a new configuration parameters before their actual application.

This method is called by the new configuration change proposal. If the proposed parameters do not fit for this service instance, it should return a corresponding error to discard this proposal. Thus only a configuration change proposal in which all changes are correct can be applied later.

The proposal approval process details, and even the configuration proposal format, depends on the particular runtime implementation.

Execution policy

At the moment, this method can only be called on behalf of the supervisor service instance. In other words, only a method with numeric ID 0 can call this method.

fn apply_config(
    &self,
    context: CallContext,
    params: Self::Params
) -> Result<(), ExecutionError>

Update service configuration with the given parameters.

The configuration parameters passed to the method are discarded immediately. So the service instance should save them by itself if it is important for the service business logic.

This method can be triggered at any time and does not follow the general transaction execution workflow, so the errors returned might be ignored.

Execution policy

At the moment, this method can only be called on behalf of the supervisor service instance. In other words, only a method with numeric ID 0 can call this method.

Loading content...

Trait Implementations

impl<T: BinaryValue> Interface for dyn Configure<Params = T>[src]

Implementors

Loading content...