You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am interested in retrieving the discriminant of the packet that I have received. Though it seams as this is not possible. And I only wish to ask if I have understood this correctly?
If we use the example from the documentation. What would hope would be possible would be to do the following:
In order to get the discriminant of message do I have to write my own function that checks the message type and return the appropriate discriminator by constructing a temporary object and extract it from the temporary object?
It seam really weird that the library user would have to go through all this trouble to get the discriminant of the received package or am I missing something?
The text was updated successfully, but these errors were encountered:
Ahh you were so right. I read the examples and how to get the discriminator from an enum and I thought was wierd that I could not get from my received package. But you were absolutely right.
use protocol::Enum;loop{ifletSome(response) = connection.receive_packet().unwrap(){println!("{:?}", response.discriminator());break;}}}
Using this actually worked for received packages as well.
I am interested in retrieving the discriminant of the packet that I have received. Though it seams as this is not possible. And I only wish to ask if I have understood this correctly?
If we use the example from the documentation. What would hope would be possible would be to do the following:
But to me it seams as the only way one can retrieve discriminators is through the enum that defines the protocol?
In order to get the discriminant of message do I have to write my own function that checks the message type and return the appropriate discriminator by constructing a temporary object and extract it from the temporary object?
It seam really weird that the library user would have to go through all this trouble to get the discriminant of the received package or am I missing something?
The text was updated successfully, but these errors were encountered: