From 7a4652abc63a2acd7890802e80ff431e641c1565 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 25 Apr 2021 18:05:32 +0100 Subject: [PATCH] authproofs: Document proof obligations Signed-off-by: Ian Jackson --- src/authproofs.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/authproofs.rs b/src/authproofs.rs index c04752fa..c3587318 100644 --- a/src/authproofs.rs +++ b/src/authproofs.rs @@ -31,15 +31,19 @@ impl Copy for Authorisation { } pub type AuthorisationSuperuser = Authorisation; impl Authorisation { + /// Proof obligation: access to this `T` has been authorised. pub const fn authorised(_v: &T) -> Authorisation { Authorisation(PhantomData) } pub fn map(self, _f: fn(&T) -> &U) -> Authorisation { self.therefore_ok() } + /// Minor proof obligation: in this case, authorised access to `T` + /// implies authorised access to `U`. pub fn therefore_ok(self) -> Authorisation { Authorisation(PhantomData) } + /// Proof obligation: access to `T` has been authorised. pub const fn authorise_any() -> Authorisation { Authorisation(PhantomData) } -- 2.30.2