Mojo struct
IntTuple
struct IntTuple[origin: ImmutableOrigin = {}]
Aliases
MinimumValue = -65534
:
Implemented traits
AnyType
,
CollectionElement
,
Copyable
,
EqualityComparable
,
Intable
,
Movable
,
Sized
,
Stringable
,
UnknownDestructibility
,
Writable
Methods
__init__
__init__(out self)
__init__(out self, *, num_elems: Int, size: Int)
@implicit
__init__(out self, *elements: Int)
__init__(out self, *elements: IntTuple[origin])
__init__(out self, *, non_owned: IntArray)
__init__(out self, existing: Self, rng: _StridedRange)
__init__(out self, dimlist: DimList)
@implicit
__init__(out self, zipper: _zip[origin, 2])
__copyinit__
__copyinit__(out self, existing: Self)
__moveinit__
__moveinit__(out self, owned existing: Self)
__getitem__
__getitem__(self, _idx: Int) -> IntTuple[self]
__getitem__(self, span: Slice) -> Self
__eq__
__eq__(self, other: Self) -> Bool
__ne__
__ne__(self, other: Self) -> Bool
elements_size
static elements_size[origin: ImmutableOrigin](elements: VariadicListMem[IntTuple[origin], origin]) -> Int
static elements_size[origin: ImmutableOrigin, n: Int](elements: InlineArray[Pointer[IntTuple, origin], n], idx: Int) -> Int
owned_copy
owned_copy(self) -> IntTuple
replace_entry
replace_entry(self, idx: Int, value: IntTuple[origin]) -> IntTuple
replace_entry(mut self, idx: Int, *, int_value: Int)
append_flatten
append_flatten(mut self, t: IntTuple[origin])
Append each element in t instead of t as one element.
append
append(mut self, *elements: IntTuple[origin])
extend
extend(mut self, tuple: IntTuple[origin])
size
size(self) -> Int
tuple_size
static tuple_size(data: IntArray) -> Int
validate_structure
validate_structure(self)
__len__
__len__(self) -> Int
__iter__
__iter__(self) -> _IntTupleIter[self, origin]
is_value
is_value(self) -> Bool
is_value(self, i: Int) -> Bool
is_tuple
is_tuple(self) -> Bool
is_tuple(self, i: Int) -> Bool
value
value(self) -> Int
value(self, i: Int) -> Int
tuple
tuple(ref self) -> ref [self] Self
write_to
write_to[W: Writer](self, mut writer: W)
__str__
__str__(self) -> String
is_equal
static is_equal(a: IntTuple[origin], b: IntTuple[origin]) -> Bool
__repr__
__repr__(self) -> String
__int__
__int__(self) -> Int
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!