Struct ChangeOrigin
pub struct ChangeOrigin {
pub action: Option<String>,
pub principal: Option<String>,
}Expand description
Who and what made a settings change: the action (or shell entry point, such as a fixed chord) that caused it, and the principal that invoked it.
A source that keeps a history ([crate::SessionSettings]) records it
beside each changed leaf, so “who changed this” has an answer and a later
system undo has its input. Both fields are optional: a write another
process made to the copy arrives with no origin at all.
Fields§
§action: Option<String>The action id (appearance.theme.dark) or shell entry point
(fixed-toggle-mouse-keys) that made the change.
principal: Option<String>Who invoked it: ChangeOrigin::LOCAL_USER for the person at this
device’s own input, else the collaborator’s or agent’s principal.
Implementations§
§impl ChangeOrigin
impl ChangeOrigin
pub const LOCAL_USER: &'static str = "local-user"
pub const LOCAL_USER: &'static str = "local-user"
The person at this device’s keyboard, pointer or touch screen.
pub fn action(action: impl Into<String>) -> ChangeOrigin
pub fn action(action: impl Into<String>) -> ChangeOrigin
A change action made, with no principal known yet.
pub fn by(self, principal: impl Into<String>) -> ChangeOrigin
pub fn by(self, principal: impl Into<String>) -> ChangeOrigin
This origin, invoked by principal.
pub fn local(action: impl Into<String>) -> ChangeOrigin
pub fn local(action: impl Into<String>) -> ChangeOrigin
action, invoked by the person at this device’s own input.
Trait Implementations§
§impl Clone for ChangeOrigin
impl Clone for ChangeOrigin
§fn clone(&self) -> ChangeOrigin
fn clone(&self) -> ChangeOrigin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ChangeOrigin
impl Debug for ChangeOrigin
§impl Default for ChangeOrigin
impl Default for ChangeOrigin
§fn default() -> ChangeOrigin
fn default() -> ChangeOrigin
§impl<'de> Deserialize<'de> for ChangeOrigin
impl<'de> Deserialize<'de> for ChangeOrigin
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChangeOrigin, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChangeOrigin, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for ChangeOrigin
impl PartialEq for ChangeOrigin
§impl Serialize for ChangeOrigin
impl Serialize for ChangeOrigin
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for ChangeOrigin
impl StructuralPartialEq for ChangeOrigin
Auto Trait Implementations§
impl Freeze for ChangeOrigin
impl RefUnwindSafe for ChangeOrigin
impl Send for ChangeOrigin
impl Sync for ChangeOrigin
impl Unpin for ChangeOrigin
impl UnsafeUnpin for ChangeOrigin
impl UnwindSafe for ChangeOrigin
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