Mojo trait
AsBytes
The AsBytes
trait denotes a type that can be returned as a immutable byte span.
Implemented traits
AnyType
,
UnknownDestructibility
Methods
as_bytes
as_bytes(ref self: _Self) -> Span[SIMD[uint8, 1], self_is_origin]
Returns a contiguous slice of the bytes owned by this string.
Notes: This does not include the trailing null terminator.
Returns:
A contiguous slice pointing to the bytes owned by this string.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!