pub struct ConfigRoleStore {
pub config_prefix: &'static str,
pub role_prefix: &'static str,
}Expand description
The storage prefixes an engine keeps its operator documents under.
Fields§
§config_prefix: &'static str§role_prefix: &'static strImplementations§
Source§impl ConfigRoleStore
impl ConfigRoleStore
pub const fn new(config_prefix: &'static str, role_prefix: &'static str) -> Self
pub async fn load_config<C: DeserializeOwned>( &self, storage: &dyn StorageBackend, name: &str, ) -> EngineResult<Option<C>>
pub async fn load_role<R: DeserializeOwned>( &self, storage: &dyn StorageBackend, name: &str, ) -> EngineResult<Option<R>>
Sourcepub async fn require_role<R: DeserializeOwned>(
&self,
storage: &dyn StorageBackend,
name: &str,
) -> EngineResult<R>
pub async fn require_role<R: DeserializeOwned>( &self, storage: &dyn StorageBackend, name: &str, ) -> EngineResult<R>
Loads a role, or fails with the error an engine’s generate() should
surface when the role was never defined.
pub async fn require_config<C: DeserializeOwned>( &self, storage: &dyn StorageBackend, name: &str, ) -> EngineResult<C>
Sourcepub async fn handle_read<R: DeserializeOwned + Serialize>(
&self,
storage: &dyn StorageBackend,
path: &str,
) -> EngineResult<Value>
pub async fn handle_read<R: DeserializeOwned + Serialize>( &self, storage: &dyn StorageBackend, path: &str, ) -> EngineResult<Value>
read dispatch. Roles are returned in full; a config read deliberately
returns only whether it exists, because the document holds the root
credential and nothing above this layer should be able to read it back.
pub async fn handle_write<C, R>( &self, storage: &dyn StorageBackend, path: &str, data: Value, ) -> EngineResult<()>
pub async fn handle_delete( &self, storage: &dyn StorageBackend, path: &str, ) -> EngineResult<()>
pub async fn handle_list( &self, storage: &dyn StorageBackend, prefix: &str, ) -> EngineResult<Vec<String>>
Auto Trait Implementations§
impl Freeze for ConfigRoleStore
impl RefUnwindSafe for ConfigRoleStore
impl Send for ConfigRoleStore
impl Sync for ConfigRoleStore
impl Unpin for ConfigRoleStore
impl UnsafeUnpin for ConfigRoleStore
impl UnwindSafe for ConfigRoleStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more