pub struct KeyResult {
pub handled: bool,
pub commit: Option<String>,
pub diagnostic: Option<String>,
}Expand description
Outcome of one key or action. A result can be handled and still carry a diagnostic, for example when learning could not be persisted.
Fields§
§handled: bool§commit: Option<String>§diagnostic: Option<String>Implementations§
Source§impl KeyResult
impl KeyResult
pub fn unhandled() -> Self
pub fn handled() -> Self
pub fn committed(text: impl Into<String>) -> Self
pub fn with_diagnostic(self, diagnostic: Option<String>) -> Self
Sourcepub fn diagnostic_code(&self) -> Option<DiagnosticCode>
pub fn diagnostic_code(&self) -> Option<DiagnosticCode>
diagnostic 的稳定数字码(映射表见 diagnostics::DIAGNOSTIC_CODES);没有诊断时为 None。
Trait Implementations§
impl Eq for KeyResult
impl StructuralPartialEq for KeyResult
Auto Trait Implementations§
impl Freeze for KeyResult
impl RefUnwindSafe for KeyResult
impl Send for KeyResult
impl Sync for KeyResult
impl Unpin for KeyResult
impl UnsafeUnpin for KeyResult
impl UnwindSafe for KeyResult
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.