On the need for a buffer: On embedded systems you usually don't use an allocator, so to_slice can't return a Vec or Box of data. So there are two options: * Use a fixed size data structure that is passed in return ([heapless::Vec](https://docs.rs/heapless/latest/heapless/struct.Vec.html) is popular), or * ask the application to provide buffer space into which the data ca be written. That approach is more flexible, and on APIs that support zero-copy (which this socket API does not), this has extra benefits. The to_slice function here chooses the latter. If it is indeed returning an empty slice, that may or may not be a part of the buffer (doesn't really matter). But any non-trivial non-empty slice it returns will be part of the buffer.