2 ms·
I am not familiar with the in-memory representation of Slice, but conceptually at least, yes. We call &str a "string slice" and &[T] more generally a "slice".
by steveklabnik 8y ago
I am not familiar with the in-memory representation of Slice, but conceptually at least, yes. We call &str a "string slice" and &[T] more generally a "slice".
EDIT: apparently you just edited from Slice to Span, reading https://msdn.microsoft.com/en-us/magazine/mt814808.aspx https://msdn.microsoft.com/en-us/magazine/mt814808.aspx
> First, Span<T> is a value type containing a ref and a length, defined approximately as follows:
Yep, exactly the same as Span<T> then.
- tigershark 8y agoSorry, I wrote Slice instead of Span in the original comment... Slice is the method that returns a Span that is the equivalent of this rust concept as far as I can tell. At some point in the future I’ll need to delve in rust, it’s quite fascinating, but sadly I don’t have much time nowadays :(
- steveklabnik 8y agoIt's all good, on both counts! We'll still be around when you find the time :)