How to bind buffer slices in a loop? #1433
adamnemecek
started this conversation in
General
Replies: 0 comments 1 reply
-
This doesn't sound right. A slice is never a temporary - it has the lifetime of the host, and it's borrowing the host. What is the type returned by |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey gang,
I'm not sure how to go about the following code.
Let's say, I have some struct
Layer
which contains a vertex buffer of triangles. I have aVec
of these Layers and want to render them in a loop like so:The lifetime requirements make it non-obvious how to use this since when you call
as_slice
you get a temporary.Beta Was this translation helpful? Give feedback.
All reactions