Skip to main content

MetadataPolicy

Trait MetadataPolicy 

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

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

Required Methods§

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.

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

Converts the policy to its proto representation.

Implementors§

§

impl MetadataPolicy for &MetadataBasePolicies

Implements the MetadataPolicy trait for MetadataBasePolicies.

§

impl MetadataPolicy for MetadataPolicies

Implements the MetadataPolicy trait for MetadataPolicies.

§

impl MetadataPolicy for MetadataAndCondition

Implements the MetadataPolicy trait for MetadataAndCondition.

§

impl MetadataPolicy for MetadataAnyCondition

Implements the MetadataPolicy trait for MetadataAnyCondition.