-
Notifications
You must be signed in to change notification settings - Fork 42
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
Test Fwk: Add conversions for ScVal<=>Into<RawVal> #106
Comments
@jonjove What were you needing this for? |
I want the WeakHost type not to escape the host crate. I'm not as concerned about the general concept of conversion, though I suspect it will confuse users that some-but-not-all SCVals can be converted without an Env. |
Ah ok, I think I misunderstood your prior comment.
I planned to only implement the to and from EnvVal conversions, not the RawVal. I'll revive #81 then. |
If possible we should make this for conversions from |
We should add a
impl TryFrom<ScVal> for RawVal
that can convert anScVal
to aRawVal
. It wouldn't be able to support all types but it could support all but theSCV_OBJECT
arm.For the XDR types that parallel types that are
RawValConvertible
we should also add aimpl From<_> for RawVal
. This would be for any arm that has a non-builtin type. i.e.SCV_STATIC
,SCV_SYMBOL
, andSCV_STATUS
.We can also implement conversions in the opposite direction and most will be symmetrical, except the
SCV_POS_I64
arm that would not be able to convert the other way for negative values of int64.@jonjove asked for how to do these conversions in a meeting today. @graydon suggested we should have this in the common package.
cc @jonjove @graydon
The text was updated successfully, but these errors were encountered: