Enum Refusal
pub enum Refusal {
Show 17 variants
NotPermitted(String),
NeedsApproval(String),
Owner,
OwnerRole,
AboveActorRole {
actor: Option<Role>,
wanted: Role,
},
AboveActorGrant {
kind: ActionKind,
held: Answer,
wanted: Answer,
},
OutsideRoom(TreePath),
NotBelowActor {
actor: Option<Role>,
target: Role,
},
Banned(String),
Restricted(String),
NotBanned(String),
NotRestricted(String),
InThePast(u64),
NotAMember(String),
AlreadyAMember(String),
UnknownGrant(GrantId),
DuplicateGrant(GrantId),
}Expand description
Why a governance action was refused.
Variants§
NotPermitted(String)
The actor’s grants do not allow the action; carries the explanation.
NeedsApproval(String)
The action asks first and no approval was witnessed.
Owner
The owner cannot be removed, demoted or made a member.
OwnerRole
Ownership is not handed out through membership.
AboveActorRole
An invite or membership above the actor’s own role.
AboveActorGrant
A grant giving more than the actor holds on its node.
OutsideRoom(TreePath)
A grant on a node outside this room.
NotBelowActor
A membership action on someone the actor does not outrank: a Moderator reaches only members below Moderator, and nobody bans themselves.
Banned(String)
The person is banned: unban them first.
Restricted(String)
The person is restricted: they change nothing, the room’s governance included, until the restriction lapses or is lifted.
NotBanned(String)
The person is not banned.
NotRestricted(String)
The person holds no live restriction.
InThePast(u64)
A restriction ending at or before now restricts nothing.
NotAMember(String)
AlreadyAMember(String)
UnknownGrant(GrantId)
DuplicateGrant(GrantId)
Trait Implementations§
§impl Error for Refusal
impl Error for Refusal
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl Eq for Refusal
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Freeze for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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.§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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