File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -457,6 +457,19 @@ impl std::iter::IntoIterator for MeasurementSet {
457457 }
458458}
459459
460+ impl std:: fmt:: Display for MeasurementSet {
461+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
462+ writeln ! ( f, "measurement set" ) ?;
463+ for m in & self . 0 {
464+ writeln ! ( f, " {}" , m) ?;
465+ }
466+ if self . 0 . is_empty ( ) {
467+ writeln ! ( f, "(set is empty)" ) ?;
468+ }
469+ Ok ( ( ) )
470+ }
471+ }
472+
460473/// A collection of measurement values that is used as a source of truth when
461474/// appraising the set of measurements derived from an attestation.
462475pub struct ReferenceMeasurements ( pub ( crate ) HashSet < Measurement > ) ;
@@ -488,6 +501,19 @@ impl TryFrom<&[Corim]> for ReferenceMeasurements {
488501 }
489502}
490503
504+ impl std:: fmt:: Display for ReferenceMeasurements {
505+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
506+ writeln ! ( f, "Reference measurements" ) ?;
507+ for m in & self . 0 {
508+ writeln ! ( f, " {}" , m) ?;
509+ }
510+ if self . 0 . is_empty ( ) {
511+ writeln ! ( f, "(set is empty)" ) ?;
512+ }
513+ Ok ( ( ) )
514+ }
515+ }
516+
491517/// Errors produced by the `verify_attestation` function
492518#[ derive( Debug , Error ) ]
493519pub enum VerifyAttestationError {
You can’t perform that action at this time.
0 commit comments