pub trait NfcHost:
Send
+ Sync
+ 'static {
// Required methods
fn availability(&self) -> Result<NfcAvailability, NfcError>;
fn scan_tag(&self, request: NfcScanRequest) -> Result<NfcTag, NfcError>;
fn write_tag(
&self,
request: NfcWriteRequest,
) -> Result<NfcSessionReceipt, NfcError>;
fn emulate_tag(
&self,
request: NfcEmulationRequest,
) -> Result<NfcSessionReceipt, NfcError>;
fn cancel_session(&self) -> Result<(), NfcError>;
}Expand description
Host-side NFC provider used by shell capability registration.
Required Methods§
Sourcefn availability(&self) -> Result<NfcAvailability, NfcError>
fn availability(&self) -> Result<NfcAvailability, NfcError>
Returns NFC support, enabled state, and supported operation modes.
Sourcefn scan_tag(&self, request: NfcScanRequest) -> Result<NfcTag, NfcError>
fn scan_tag(&self, request: NfcScanRequest) -> Result<NfcTag, NfcError>
Starts a read session and returns the first matching NFC tag.
request carries technology filters, prompt text, timeout, and record
collection behavior.
Sourcefn write_tag(
&self,
request: NfcWriteRequest,
) -> Result<NfcSessionReceipt, NfcError>
fn write_tag( &self, request: NfcWriteRequest, ) -> Result<NfcSessionReceipt, NfcError>
Starts a write session for the supplied NFC records.
Sourcefn emulate_tag(
&self,
request: NfcEmulationRequest,
) -> Result<NfcSessionReceipt, NfcError>
fn emulate_tag( &self, request: NfcEmulationRequest, ) -> Result<NfcSessionReceipt, NfcError>
Starts card emulation for hosts and hardware that support it.
Sourcefn cancel_session(&self) -> Result<(), NfcError>
fn cancel_session(&self) -> Result<(), NfcError>
Cancels the active NFC scan, write, or emulation session.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".