11use std:: collections:: HashMap ;
2+ use std:: fmt:: { Display , Formatter } ;
23use std:: str:: FromStr ;
34
45#[ derive( Debug , PartialEq , Eq , Hash , Clone , serde:: Serialize ) ]
@@ -38,6 +39,16 @@ impl FromStr for ValidationPreset {
3839 }
3940}
4041
42+ impl Display for ValidationPreset {
43+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
44+ match self {
45+ Self :: Basic => write ! ( f, "basic" ) ,
46+ Self :: Extended => write ! ( f, "extended" ) ,
47+ Self :: Full => write ! ( f, "full" ) ,
48+ }
49+ }
50+ }
51+
4152pub trait Validate {
4253 /// Validates this object according to a validation preset
4354 fn validate_preset ( & ' static self , preset : ValidationPreset ) ;
@@ -46,8 +57,7 @@ pub trait Validate {
4657 fn validate_by_test ( & self , version : & str ) ;
4758}
4859
49- pub type Test < VersionedDocument > =
50- fn ( & VersionedDocument ) -> Result < ( ) , ValidationError > ;
60+ pub type Test < VersionedDocument > = fn ( & VersionedDocument ) -> Result < ( ) , ValidationError > ;
5161
5262/// Represents something which is validatable according to the CSAF standard.
5363/// This trait MUST be implemented by the struct that represents a CSAF document
0 commit comments