pub struct IncapacitySwitch {
pub principal_did: String,
pub kind: IncapacityKind,
pub trigger: IncapacityTrigger,
pub advocate_did: String,
pub active_since_unix: Option<u64>,
}Expand description
A reversible incapacity switch: activates a pre-designated advocate under the trigger, reverses on recovery.
Fields§
§principal_did: String§kind: IncapacityKind§trigger: IncapacityTrigger§advocate_did: StringThe advocate/trustee pre-designated to act during incapacity (scoped, revocable — a care/steward role, never custody of the person’s fabric).
active_since_unix: Option<u64>Some(t) while the advocate is active (incapacitated since t); None when the person has capacity.
Implementations§
Source§impl IncapacitySwitch
impl IncapacitySwitch
Sourcepub fn advocate_active(&self) -> bool
pub fn advocate_active(&self) -> bool
Is the advocate currently acting (the person incapacitated)?
Sourcepub fn can_activate(
&self,
attesting_parties: &[String],
official_instrument: Option<&str>,
) -> bool
pub fn can_activate( &self, attesting_parties: &[String], official_instrument: Option<&str>, ) -> bool
Whether the switch can be activated now (trigger satisfied and not already active).
Sourcepub fn activate(
&mut self,
attesting_parties: &[String],
official_instrument: Option<&str>,
now_unix: u64,
) -> bool
pub fn activate( &mut self, attesting_parties: &[String], official_instrument: Option<&str>, now_unix: u64, ) -> bool
Activate advocacy if the trigger is satisfied. Returns whether it activated.
Sourcepub fn regain_capacity(&mut self, _now_unix: u64)
pub fn regain_capacity(&mut self, _now_unix: u64)
The person regained capacity — reverse: the advocate stands down, control reverts to the principal. The reversibility that distinguishes incapacity from death.
Trait Implementations§
Source§impl Clone for IncapacitySwitch
impl Clone for IncapacitySwitch
Source§fn clone(&self) -> IncapacitySwitch
fn clone(&self) -> IncapacitySwitch
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 IncapacitySwitch
impl Debug for IncapacitySwitch
Source§impl<'de> Deserialize<'de> for IncapacitySwitch
impl<'de> Deserialize<'de> for IncapacitySwitch
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for IncapacitySwitch
impl PartialEq for IncapacitySwitch
Source§fn eq(&self, other: &IncapacitySwitch) -> bool
fn eq(&self, other: &IncapacitySwitch) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for IncapacitySwitch
impl Serialize for IncapacitySwitch
impl Eq for IncapacitySwitch
impl StructuralPartialEq for IncapacitySwitch
Auto Trait Implementations§
impl Freeze for IncapacitySwitch
impl RefUnwindSafe for IncapacitySwitch
impl Send for IncapacitySwitch
impl Sync for IncapacitySwitch
impl Unpin for IncapacitySwitch
impl UnsafeUnpin for IncapacitySwitch
impl UnwindSafe for IncapacitySwitch
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. Read more
§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>
Converts
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>
Converts
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