Skip to content

Does Sample Loaning (not in data-sharing) require bounded type? #5087

Answered by JesusPoderoso
zoeeer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zoeeer,
There is a distinction between using loans in the DataWriter and the DataReader.
It is mandatory for the type to be plain to use loans in the DataWriter.
It is NOT mandatory for the type to be plain to use loans in the DataReader.
If it is not plain, DataReader requests TypeSupport the data and deserializes that payload.

The bounded type is a data-sharing requirement, not related to loans.
It may not be very clear because the related discussion linked was related to the zero-copy mechanism, which is a combination of loans and data-sharing.
Zero-copy's constraint is the type to be plain. And if the type is plain, it is already bounded (it is a conditional statement: If plain th…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zoeeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants