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§
Sourcefn evaluate(
&self,
actor: &CommitParticipant,
change: &MetadataFieldChange,
) -> bool
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.
Sourcefn to_proto(&self) -> Result<MetadataPolicyProto, PolicyError>
fn to_proto(&self) -> Result<MetadataPolicyProto, 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.