-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot access GPSTime
inside BaseTime
#1331
Comments
Not sure what exactly your use-case is but there is a function that converts libsbp/rust/sbp/src/sbp_iter_ext.rs Line 48 in 6997d9f
It's not showing up in the docs because it requires the It might not be want you want because it excludes BaseTime messages, but it takes care of tracking the week number for you which is nice. Either way we have a fix for this on the way 😄 |
Thank you! I will patch locally waiting for the fix. |
# Description @swift-nav/devinfra This PR converts the BaseTime tuple struct into an enum with one variant and makes it non_exhaustive. This enables users to access the time inside and makes it similar to how RoverTime can be used. # API compatibility Does this change introduce a API compatibility risk? In general you cannot convert an struct to an enum without it being a breaking change. However, because the enum was a tuple struct with private fields it's constructor was also private, and you cannot create it even with the dot syntax. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0369878bb675f5734febf4ad1eebf327 So that means that the chances of this being a breaking change is very small and I feel comfortable marking this as a minor change. If the above is "Yes", please detail the compatibility (or migration) plan: N/A # JIRA Reference would resolve: #1331 --------- Co-authored-by: Jason Mobarak <jason@swift-nav.com>
# Description @swift-nav/devinfra This PR converts the BaseTime tuple struct into an enum with one variant and makes it non_exhaustive. This enables users to access the time inside and makes it similar to how RoverTime can be used. # API compatibility Does this change introduce a API compatibility risk? In general you cannot convert an struct to an enum without it being a breaking change. However, because the enum was a tuple struct with private fields it's constructor was also private, and you cannot create it even with the dot syntax. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0369878bb675f5734febf4ad1eebf327 So that means that the chances of this being a breaking change is very small and I feel comfortable marking this as a minor change. If the above is "Yes", please detail the compatibility (or migration) plan: N/A # JIRA Reference would resolve: swift-nav/libsbp#1331 --------- Co-authored-by: Jason Mobarak <jason@swift-nav.com> Triggered-By: libsbp 25e15c6c7d63c6cdd73cf38f6d6bffd2fe80f84e Upstream-PR: http://github.com/swift-nav/libsbp/pull/1332
Release v4.14.1 with this fix has been cut (and now available on crates.io). |
Thank you so much! |
# Description @swift-nav/devinfra This PR converts the BaseTime tuple struct into an enum with one variant and makes it non_exhaustive. This enables users to access the time inside and makes it similar to how RoverTime can be used. # API compatibility Does this change introduce a API compatibility risk? In general you cannot convert an struct to an enum without it being a breaking change. However, because the enum was a tuple struct with private fields it's constructor was also private, and you cannot create it even with the dot syntax. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0369878bb675f5734febf4ad1eebf327 So that means that the chances of this being a breaking change is very small and I feel comfortable marking this as a minor change. If the above is "Yes", please detail the compatibility (or migration) plan: N/A # JIRA Reference would resolve: swift-nav/libsbp#1331 --------- Co-authored-by: Jason Mobarak <jason@swift-nav.com> Triggered-By: libsbp 25e15c6c7d63c6cdd73cf38f6d6bffd2fe80f84e Upstream-PR: http://github.com/swift-nav/libsbp/pull/1332
Hello,
I am trying to extract a timestamp from each SBPMessage that contains one (Rust).
I found the function
gps_time()
by enabling the featureswiftnav
:However
BaseTime
is a struct that containsgps_time
as a private field:https://github.com/swift-nav/libsbp/blob/d122b3b82e048e8a313967332ad97ebf05cc80c3/rust/sbp/src/time.rs#LL92C1-L92C1
So I can't access it.
Is this a bug or am I not supposed to do things this way?
Thanks,
Marco
The text was updated successfully, but these errors were encountered: