-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Oh, right, yeah, object safe methods for traits...
- Loading branch information
1 parent
d1af59e
commit 30b8207
Showing
4 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use async_trait::async_trait; | ||
use crate::{ | ||
platform::PlatformUrl, | ||
ac::{ | ||
traits::{ | ||
PolicyBackend, | ||
ResourceBackend, | ||
UserBackend, | ||
}, | ||
}, | ||
}; | ||
|
||
/// ACPlatform - Access Control Platform | ||
/// | ||
/// This platform is used to persist access control information for PMR. | ||
/// | ||
/// This trait is applicable to everything that correctly implements the | ||
/// relevant backends that compose this trait. | ||
#[async_trait] | ||
pub trait ACPlatform: PolicyBackend | ||
+ ResourceBackend | ||
+ UserBackend | ||
|
||
+ PlatformUrl | ||
|
||
+ Send | ||
+ Sync | ||
{ | ||
fn as_dyn(&self) -> &(dyn ACPlatform); | ||
} | ||
|
||
impl<P: PolicyBackend | ||
+ ResourceBackend | ||
+ UserBackend | ||
|
||
+ PlatformUrl | ||
|
||
+ Send | ||
+ Sync | ||
> ACPlatform for P { | ||
fn as_dyn(&self) -> &(dyn ACPlatform) { | ||
self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters