Skip to main content

MetadataPolicy

Trait MetadataPolicy 

Source
pub trait MetadataPolicy: Debug {
    // Required methods
    fn evaluate(
        &self,
        actor: &CommitParticipant,
        change: &MetadataFieldChange,
    ) -> bool;
    fn to_proto(&self) -> Result<MetadataPolicyProto, PolicyError>;
}
Expand description

A trait for policies that can update Metadata for the group.

Required Methods§

Source

fn evaluate( &self, actor: &CommitParticipant, change: &MetadataFieldChange, ) -> bool

Evaluates the policy for a given actor and metadata change.

Verify relevant metadata is actually changed before evaluating against the MetadataPolicy. See evaluate_metadata_policy.

Source

fn to_proto(&self) -> Result<MetadataPolicyProto, PolicyError>

Converts the policy to its proto representation.

Implementors§

Source§

impl MetadataPolicy for &MetadataBasePolicies

Implements the MetadataPolicy trait for MetadataBasePolicies.

Source§

impl MetadataPolicy for MetadataPolicies

Implements the MetadataPolicy trait for MetadataPolicies.

Source§

impl MetadataPolicy for MetadataAndCondition

Implements the MetadataPolicy trait for MetadataAndCondition.

Source§

impl MetadataPolicy for MetadataAnyCondition

Implements the MetadataPolicy trait for MetadataAnyCondition.