pub enum Availability {
Available,
Unavailable {
code: String,
reason: String,
},
}Expand description
Whether an action can be invoked in the resource’s current state.
Variants§
Available
Implementations§
Source§impl Availability
impl Availability
pub fn serialize<__S>(
__self: &Availability,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
Source§impl<'de> Availability
impl<'de> Availability
pub fn deserialize<__D>(__deserializer: __D) -> Result<Availability, __D::Error>where
__D: Deserializer<'de>,
Source§impl Availability
impl Availability
Sourcepub const NOT_ALLOWED: &'static str = "not_allowed"
pub const NOT_ALLOWED: &'static str = "not_allowed"
The code of an action its caller’s permissions deny (Self::not_allowed).
Sourcepub const NOT_ALLOWED_HERE: &'static str = "this workspace's permissions don't let you do \
this here; the person you work for can change what you may do under Workspace \
settings → Agents"
pub const NOT_ALLOWED_HERE: &'static str = "this workspace's permissions don't let you do \ this here; the person you work for can change what you may do under Workspace \ settings → Agents"
What an action refused by a check that does not say which rule refused it is told.
Sourcepub const PRIVATE_VIEW: &'static str = "private_view"
pub const PRIVATE_VIEW: &'static str = "private_view"
The code of an action only the person at its device invokes
(Self::shown_here).
Sourcepub const SHOWN_HERE: &'static str = "only changes what the person at this device sees; only they invoke it"
pub const SHOWN_HERE: &'static str = "only changes what the person at this device sees; only they invoke it"
Why an action Self::shown_here is refused to anyone but the
person at its device.
pub fn is_available(&self) -> bool
Sourcepub fn not_allowed(by: Option<Refuser>) -> Self
pub fn not_allowed(by: Option<Refuser>) -> Self
An action an agent’s permissions deny it, as it is listed to the agent: told, in one
sentence, what refuses it (by, where the check knows) and where that is changed, rather
than left to read the action’s absence as there being no such action.
Sourcepub fn shown_here() -> Self
pub fn shown_here() -> Self
An action that only changes what the person at its device sees (a form it opens, a place it shows), as an agent that names it is told of it: never listed to it, and refused as that person’s alone rather than as an action the app does not have.
Sourcepub fn refusal(&self) -> Option<(&str, &str)>
pub fn refusal(&self) -> Option<(&str, &str)>
The code and reason of an action listed to an agent as refused
(Self::not_allowed, Self::shown_here), when it is.
Trait Implementations§
Source§impl Clone for Availability
impl Clone for Availability
Source§impl Debug for Availability
impl Debug for Availability
Source§impl Default for Availability
impl Default for Availability
Source§impl<'de> Deserialize<'de> for Availability
impl<'de> Deserialize<'de> for Availability
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Availability
Source§impl PartialEq for Availability
impl PartialEq for Availability
Source§impl Serialize for Availability
impl Serialize for Availability
impl StructuralPartialEq for Availability
Auto Trait Implementations§
impl Forget for Availability
impl Freeze for Availability
impl Move for Availability
impl RefUnwindSafe for Availability
impl Send for Availability
impl Sync for Availability
impl Unpin for Availability
impl UnsafeUnpin for Availability
impl UnwindSafe for Availability
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more