File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //! Built-in policies for Sigsum.
2+ //!
3+ //! This module contains all the included built-in policies. These can be accessed
4+ //! and used directly as public statics, or looked up at runtime by name via
5+ //! [`Policy::builtin`].
6+
17use std:: ops:: Deref ;
28use std:: sync:: LazyLock ;
39
@@ -18,7 +24,7 @@ pub struct BuiltInPolicy {
1824}
1925
2026impl BuiltInPolicy {
21- /// Returns the policy for this built in policy. Can also be accessed
27+ /// Returns the policy for this built- in policy. Can also be accessed
2228 /// via the `Deref` implementation.
2329 pub fn policy ( & self ) -> & Policy {
2430 & self . policy
@@ -78,7 +84,7 @@ macro_rules! define_builtin_policies {
7884 } ;
7985}
8086
81- // All built in policies defined here in one single place.
87+ // All built- in policies defined here in one single place.
8288// Multiple invocations not possible since this invocation emits the `builtin` lookup function.
8389define_builtin_policies ! {
8490 SIGSUM_TEST1_2025 = "sigsum-test1-2025" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ pub use parsing::ParsePolicyError;
1212/// The Sigsum policy dictates if a signed tree head is considered valid (and by extension, if a
1313/// Sigsum signature is valid).
1414///
15- /// This library contains a bunch of built in policies, ready for use in [`builtin`].
15+ /// This library contains a bunch of built- in policies, ready for use in [`builtin`].
1616#[ derive( Debug , Eq , PartialEq ) ]
1717pub struct Policy {
1818 // logs keeps the list of log keys and URLs indexed by keyhash.
@@ -60,6 +60,8 @@ impl<'a> Iterator for Logs<'a> {
6060
6161impl Policy {
6262 /// Returns a built-in policy by name, if one exists.
63+ ///
64+ /// See [`builtin`] for public static definitions of these policies.
6365 pub fn builtin ( name : & str ) -> Option < & ' static Self > {
6466 builtin:: builtin ( name)
6567 }
You can’t perform that action at this time.
0 commit comments