#[non_exhaustive]pub struct Capability {
pub action: String,
pub title: String,
pub source: ApiSourceFamily,
pub method: Option<String>,
pub path: Option<String>,
pub mutating: bool,
pub auth_scope: AuthScope,
pub verification_mode: Option<String>,
}Expand description
One dispatchable UniFi action: its name, which API serves it, and (for non-hybrid actions) the method/path template to call.
#[non_exhaustive]: instances only ever come from
all_capabilities/find_capability — nothing outside this crate
constructs one via struct literal — so a future added field (e.g. a
rate-limit hint) should not be a downstream semver break.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.action: StringAction name, as passed to crate::ActionRequest::action.
title: StringHuman-readable summary, e.g. for listing available actions in a UI.
source: ApiSourceFamilyWhich API this capability is served from.
method: Option<String>HTTP method. None only for ApiSourceFamily::Hybrid entries,
which resolve to another capability’s method at dispatch time.
path: Option<String>Path template, e.g. /v1/sites/{siteId}. None only for
ApiSourceFamily::Hybrid entries.
mutating: boolWhether this action changes controller state.
auth_scope: AuthScopeMinimum caller permission required. Not enforced by this crate —
see the note on AuthScope.
verification_mode: Option<String>Provenance/confidence tag from the source inventory (e.g.
"contract_ok", "legacy_alias"); informational only.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Capability
impl Debug for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
Source§fn eq(&self, other: &Capability) -> bool
fn eq(&self, other: &Capability) -> bool
self and other values to be equal, and is used by ==.impl Eq for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.