Skip to content

feat(#401): add public model types for ModemManager domain#416

Merged
cachebag merged 6 commits into
masterfrom
modem-models
May 12, 2026
Merged

feat(#401): add public model types for ModemManager domain#416
cachebag merged 6 commits into
masterfrom
modem-models

Conversation

@cachebag
Copy link
Copy Markdown
Collaborator

This PR Defines the initial public surface for the mmrs crate: Modem, ModemState, and AccessTechnology for modem-level state; Sim and SimLockState for SIM slots; Bearer, BearerConfig, BearerStats, Ip4Config, and IpType for packet-data bearers; and ModemError plus a Result alias for fallible operations.

Constants and predicates (from_raw, has_lte, is_3gpp, requires_pin, etc.) decode ModemManager's MM_MODEM_STATE_*, MM_MODEM_ACCESS_TECHNOLOGY_*, MM_MODEM_LOCK_*, and MM_BEARER_IP_FAMILY_* constants so callers never touch raw integers. Types live under mmrs::api::models and are re-exported at the crate root and via pub mod models.

@cachebag cachebag requested a review from Copilot May 12, 2026 12:46
@cachebag cachebag self-assigned this May 12, 2026
@cachebag cachebag added api-surface Public API design, re-exports, and semver-relevant changes builders Connection builder API and validation mmrs modemmanager bindings crate modem modem device and bearer management sim sim card and pin operations labels May 12, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces the initial public “model types” layer for the mmrs crate, providing typed representations of ModemManager concepts (modems, SIMs, bearers) plus a crate error type and Result alias so callers can avoid working with raw integer constants.

Changes:

  • Adds public model types under mmrs::api::models, re-exported via mmrs::models and at the crate root.
  • Implements decoding helpers/predicates for ModemManager state/bitmask/lock constants (from_raw, has_lte, is_3gpp, requires_pin, etc.).
  • Adds ModemError and a Result<T> alias; updates crate docs and changelog; adds thiserror dependency.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mmrs/src/lib.rs Adds crate-level docs and re-exports for the new public model surface (mmrs::models and root re-exports).
mmrs/src/api/mod.rs Documents the api module and exposes api::models.
mmrs/src/api/models/mod.rs Defines the models module structure and re-exports all model types.
mmrs/src/api/models/modem.rs Adds ModemState, AccessTechnology, and Modem snapshot types with decoding/predicates/tests.
mmrs/src/api/models/sim.rs Adds Sim and SimLockState with decoding/predicates/tests.
mmrs/src/api/models/bearer.rs Adds bearer-related types (Bearer, BearerConfig, BearerStats, Ip4Config, IpType) with tests.
mmrs/src/api/models/error.rs Adds ModemError and Result alias with tests.
mmrs/CHANGELOG.md Documents the newly added public model types.
mmrs/Cargo.toml Adds thiserror workspace dependency for error derivations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mmrs/src/api/models/modem.rs Outdated
Comment thread mmrs/src/api/models/modem.rs
Comment thread mmrs/src/api/models/bearer.rs
Comment thread mmrs/src/lib.rs Outdated
@cachebag cachebag merged commit 792f9a9 into master May 12, 2026
6 checks passed
@cachebag cachebag deleted the modem-models branch May 12, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-surface Public API design, re-exports, and semver-relevant changes builders Connection builder API and validation mmrs modemmanager bindings crate modem modem device and bearer management sim sim card and pin operations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants