pub struct PluginMeta {
pub level: SecurityLevel,
pub held_caps: Vec<CapId>,
}Expand description
Plugin security metadata (extractable)
Corresponds to Lean: structure PluginMeta
INVARIANT: held_caps is sorted, no duplicates
Fields§
§level: SecurityLevelSecurity level of this plugin
held_caps: Vec<CapId>Capabilities held by this plugin (sorted Vec)
Implementations§
Source§impl PluginMeta
impl PluginMeta
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create empty plugin metadata (Public level, no capabilities)
Corresponds to Lean: def PluginMeta.empty
Sourcepub fn grant_cap(&mut self, cap_id: CapId)
pub fn grant_cap(&mut self, cap_id: CapId)
Grant a capability to this plugin (maintains sorted order)
Corresponds to Lean: def PluginMeta.grant_cap
Production version: uses binary_search for efficiency
Sourcepub fn revoke_cap(&mut self, cap_id: CapId)
pub fn revoke_cap(&mut self, cap_id: CapId)
Corresponds to Lean: def PluginMeta.grant_cap
Uses while-index loops only.
Revoke a capability from this plugin
Corresponds to Lean: def PluginMeta.revoke_cap
Trait Implementations§
Source§impl Clone for PluginMeta
impl Clone for PluginMeta
Source§fn clone(&self) -> PluginMeta
fn clone(&self) -> PluginMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginMeta
impl Debug for PluginMeta
Source§impl Default for PluginMeta
impl Default for PluginMeta
Source§impl PartialEq for PluginMeta
impl PartialEq for PluginMeta
Source§fn eq(&self, other: &PluginMeta) -> bool
fn eq(&self, other: &PluginMeta) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PluginMeta
impl StructuralPartialEq for PluginMeta
Auto Trait Implementations§
impl Freeze for PluginMeta
impl RefUnwindSafe for PluginMeta
impl Send for PluginMeta
impl Sync for PluginMeta
impl Unpin for PluginMeta
impl UnsafeUnpin for PluginMeta
impl UnwindSafe for PluginMeta
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