stringref
Implements the StringRef class.
StringRef
Represent a constant reference to a string, i.e. a sequence of characters and a length, which need not be null terminated.
Fields:
-
data (
DTypePointer[si8, 0]
): A pointer to the beginning of the string data being referenced. -
length (
Int
): The length of the string being referenced.
Implemented traits:
AnyType
, Boolable
, CollectionElement
, Copyable
, EqualityComparable
, Hashable
, IntableRaising
, Movable
, Sized
, Stringable
Methods:
__init__
__init__(str: StringLiteral) -> Self
Construct a StringRef value given a constant string.
Args:
- str (
StringLiteral
): The input constant string.
Returns:
Constructed StringRef
object.
__init__(ptr: Pointer[SIMD[si8, 1], 0], len: Int) -> Self
Construct a StringRef value given a (potentially non-0 terminated string).
The constructor takes a raw pointer and a length.
Args:
- ptr