Closed foxfriends closed 3 years ago
Option<T> does not serialize the same way as other enums. Attempting to use such an option from Lumber is proving to be confusing.
Option<T>
There are two options here (no pun intended):
'Option'('Some'(T))
'Option'('None')
?T
!T
None
_
Some(T)
T
()
Option<T>
does not serialize the same way as other enums. Attempting to use such an option from Lumber is proving to be confusing.There are two options here (no pun intended):
'Option'('Some'(T))
and'Option'('None')
)?T
and!T
are patterns that match on the current bound-ness of a variable):None
in Rust mean "unbound" in Lumber (serializing to_
).Some(T)
in Rust mean "bound" in Lumber (serializing toT
)._
) toNone
and a variable bound toT
toSome(T)
.()
to_
, and deserialize to()
always succeeds. (alternatively deserialize to()
only succeeds if the value remains unbound?).