| Crates.io | ndef |
| lib.rs | ndef |
| version | 0.4.0 |
| created_at | 2024-12-18 13:37:51.540441+00 |
| updated_at | 2025-06-12 13:19:42.671829+00 |
| description | This crate provides a `#[no_std]` library to implement a NFC Data Exchange Format structures. |
| homepage | |
| repository | https://github.com/Foundation-Devices/ndef-rs |
| max_upload_size | |
| id | 1487587 |
| size | 66,896 |
#![no_std] Rust library to manipulate NDEF.
alloc too)[dependencies]
ndef = "0.1.0"
use ndef::{Message, Payload, Record, RecordType};
fn main() {
let mut msg = Message::default();
let mut rec1 = Record::new(
None,
Payload::RTD(RecordType::Text {
enc: "en",
txt: "NDEF Text from Rust🦀!",
}),
);
msg.append_record(&mut rec1).unwrap();
// Print message raw data
println!("message raw data: {:?}", msg.to_vec().unwrap().as_slice());
}