pub struct NfcError {
pub code: String,
pub message: String,
}Expand description
Portable NFC error payload.
Fields§
§code: String§message: StringImplementations§
Source§impl NfcError
impl NfcError
Sourcepub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self
Creates a portable NFC error payload.
code should be stable enough for reducers or tests to match. message
should explain the host failure, such as missing hardware, disabled NFC,
timeout, incompatible tag, or unsupported write/emulation mode.
Sourcepub fn unsupported(operation: impl Into<String>) -> Self
pub fn unsupported(operation: impl Into<String>) -> Self
Creates the standard unsupported-operation NFC error.
operation should name the attempted NFC operation, for example scan,
write, or emulate. Hosts should use this when the capability exists
but the current platform or hardware cannot perform that operation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NfcError
impl<'de> Deserialize<'de> for NfcError
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
impl Eq for NfcError
impl StructuralPartialEq for NfcError
Auto Trait Implementations§
impl Freeze for NfcError
impl RefUnwindSafe for NfcError
impl Send for NfcError
impl Sync for NfcError
impl Unpin for NfcError
impl UnsafeUnpin for NfcError
impl UnwindSafe for NfcError
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.