{"id":57647,"library":"embedded-hal-mock","title":"embedded-hal-mock","description":"A collection of mocked devices that implement the embedded-hal traits.","status":"active","version":"0.11.1","language":"rust","source_language":null,"source_url":"https://github.com/dbrgn/embedded-hal-mock","tags":["embedded","hal","mock","testing","i2c","spi"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nembedded-hal-mock = \"0.11.1\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add embedded-hal-mock","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"I2cMock","correct":"use embedded_hal_mock::eh1::i2c::Mock as I2cMock;"}],"quickstart":{"code":"use embedded_hal_mock::eh1::i2c::{Mock as I2cMock, Transaction};\n\nfn main() {\n    let expectations = vec![\n        Transaction::write(0x42, vec![0x00]),\n        Transaction::read(0x42, vec![0x01]),\n    ];\n    let mut i2c = I2cMock::new(&expectations);\n    // Use i2c in tests\n    i2c.done();\n}","lang":"rust","description":"Create a mock I2C device for testing embedded-hal code."},"warnings":[],"env_vars":null,"search_vec":"'collect':6 'devic':9 'embed':2,14,17 'embedded-h':13 'embedded-hal-mock':1 'hal':3,15,18 'i2c':21 'implement':11 'mock':4,8,19 'spi':22 'test':20 'trait':16","created_at":"2026-06-16T15:51:54.693496+00:00","updated_at":"2026-06-16T15:51:54.693496+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/dbrgn/embedded-hal-mock","github":"https://github.com/dbrgn/embedded-hal-mock","docs":"https://docs.rs/embedded-hal-mock/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}