pub enum Feature {
Show 23 variants
Dashboard,
Run,
Exec,
Agents,
Inventory,
Compliance,
Activity,
Events,
Audit,
Logs,
Collect,
Analytics,
Jobs,
Schedules,
Views,
Notifications,
Rollout,
Apps,
Groups,
Config,
Jetstream,
Accounts,
Settings,
}Expand description
A gatable SPA page. serde (de)serializes each variant as its lowercase
route key (Compliance ⇄ "compliance"), which is exactly the string
stored in users.allowed_features and returned by /api/auth/me.
Variants§
Dashboard
Run
Exec
Agents
Inventory
Compliance
Activity
Events
Audit
Logs
Collect
Analytics
Jobs
Schedules
Views
Notifications
Rollout
Apps
Groups
Config
Jetstream
Accounts
Settings
Implementations§
Source§impl Feature
impl Feature
Sourcepub const ALL: [Feature; 23]
pub const ALL: [Feature; 23]
Every feature, in catalog order. Drives the SPA’s account editor checkbox list and lets the backend validate a submitted allow-list against the full known set.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The wire/DB key for this feature (matches the SPA route path minus
the leading slash). Kept in lockstep with the serde rename above.
Sourcepub fn parse(s: &str) -> Option<Feature>
pub fn parse(s: &str) -> Option<Feature>
Parse a feature key. Unknown keys yield None so callers can decide
whether to reject (create/update validation) or silently drop
(loading a stored list whose catalog has since shrunk).
Sourcepub fn canonicalize(keys: &[String]) -> Result<Vec<String>, String>
pub fn canonicalize(keys: &[String]) -> Result<Vec<String>, String>
Validate + canonicalize a submitted list of feature keys: reject the
first unknown key (returning it as the Err), de-duplicate, and return
the surviving keys in catalog order so what’s stored is stable. An
empty input is valid. Shared by the account allow-list editor and the
permission-group editor so both agree on what a valid list is.
Trait Implementations§
impl Copy for Feature
Source§impl<'de> Deserialize<'de> for Feature
impl<'de> Deserialize<'de> for Feature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Feature
impl StructuralPartialEq for Feature
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnsafeUnpin for Feature
impl UnwindSafe for Feature
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.