Skip to main content

NfcHost

Trait NfcHost 

Source
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§

Source

fn availability(&self) -> Result<NfcAvailability, NfcError>

Returns NFC support, enabled state, and supported operation modes.

Source

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.

Source

fn write_tag( &self, request: NfcWriteRequest, ) -> Result<NfcSessionReceipt, NfcError>

Starts a write session for the supplied NFC records.

Source

fn emulate_tag( &self, request: NfcEmulationRequest, ) -> Result<NfcSessionReceipt, NfcError>

Starts card emulation for hosts and hardware that support it.

Source

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".

Implementors§