Expand description
buffer slicing and other utilities
Functionsยง
- buffer_
as_ slice - Takes a
&[u8]buffer slice and returns a slice&[T]with a given number of elements of typeT - buffer_
as_ slice_ mut - Takes a mutable
&[u8]buffer slice and returns a mutable slice&[T]with a given number of elements of typeT - struct_
as_ slice_ u8 - Takes a reference to a struct of type
Tand returns a raw&[u8]slice with byte length of the typeT - substr
- Truncate a string, optionally appending another string
or appending
"..."if theappendstring isNone - substring
- Extract a substring starting at 0 and truncating it
to
min(length,str.len()).