-
I was wondering what is the correct way of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This is generally a problem with all IO sources. If you don't want to zero the memory first, the correct way to do it is to call |
Beta Was this translation helpful? Give feedback.
This is generally a problem with all IO sources. If you don't want to zero the memory first, the correct way to do it is to call
BufMut::bytes_mut
to obtain a reference into the extra capacity, then unsafely cast it to an&mut [u8]
, which you can then give to the datagram. You can then callBufMut::advance_mut
after you know how much data was written into the slice.