feat(#401): add public model types for ModemManager domain#416
Merged
Conversation
There was a problem hiding this comment.
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 viammrs::modelsand at the crate root. - Implements decoding helpers/predicates for ModemManager state/bitmask/lock constants (
from_raw,has_lte,is_3gpp,requires_pin, etc.). - Adds
ModemErrorand aResult<T>alias; updates crate docs and changelog; addsthiserrordependency.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR Defines the initial public surface for the
mmrscrate:Modem,ModemState, andAccessTechnologyfor modem-level state;SimandSimLockStatefor SIM slots;Bearer,BearerConfig,BearerStats,Ip4Config, andIpTypefor packet-data bearers; andModemErrorplus aResultalias for fallible operations.Constants and predicates (
from_raw,has_lte,is_3gpp,requires_pin, etc.) decode ModemManager'sMM_MODEM_STATE_*,MM_MODEM_ACCESS_TECHNOLOGY_*,MM_MODEM_LOCK_*, andMM_BEARER_IP_FAMILY_*constants so callers never touch raw integers. Types live undermmrs::api::modelsand are re-exported at the crate root and viapub mod models.