Skip to main content

function

reversed

reversed[T: ReversibleRange](value: T) -> _StridedRange

Get a reversed iterator of the input range.

Note: iterators are currently non-raising.

Parameters:

  • T (ReversibleRange): The type conforming to ReversibleRange.

Args:

  • value (T): The range to get the reversed iterator of.

Returns:

The reversed iterator of the range.

reversed[T: CollectionElement](value: Reference[List[T], is_mutable, lifetime, 0]) -> _ListIter[$0, $1, $2, 0]

Get a reversed iterator of the input list.

Note: iterators are currently non-raising.

Parameters:

  • T (CollectionElement): The type of the elements in the list.

Args:

  • value (Reference[List[T], is_mutable, lifetime, 0]): The list to get the reversed iterator of.

Returns:

The reversed iterator of the list.

reversed[K: KeyElement, V: CollectionElement](value: Reference[Dict[K, V], is_mutable, lifetime, 0]) -> _DictKeyIter[$0, $1, $2, $3, 0]

Get a reversed iterator of the input dict.

Note: iterators are currently non-raising.

Parameters:

  • K (KeyElement): The type of the keys in the dict.
  • V (CollectionElement): The type of the values in the dict.

Args:

  • value (Reference[Dict[K, V], is_mutable, lifetime, 0]): The dict to get the reversed iterator of.

Returns:

The reversed iterator of the dict keys.

reversed[mutability: Bool, self_life: lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,0), "value">>, K: KeyElement, V: CollectionElement, dict_mutability: Bool, dict_lifetime: lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,4), "value">>](value: !lit.ref<_stdlib::_collections::_dict::__DictValueIter<:trait<_stdlib::_collections::_dict::_KeyElement> K, :trait<_stdlib::_builtin::_value::_CollectionElement> V, :_stdlib::_builtin::_bool::_Bool dict_mutability, :lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool dict_mutability, "value">> dict_lifetime, :_stdlib::_builtin::_bool::_Bool {:i1 1}>, mut=#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool mutability, "value">, self_life>) -> _DictValueIter[$2, $3, $4, $5, 0]

Get a reversed iterator of the input dict values.

Note: iterators are currently non-raising.

Parameters:

  • mutability (Bool): Whether the reference to the dict is mutable.
  • self_life (lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,0), "value">>): The lifetime of the dict.
  • K (KeyElement): The type of the keys in the dict.
  • V (CollectionElement): The type of the values in the dict.
  • dict_mutability (Bool): Whether the reference to the dict values is mutable.
  • dict_lifetime (lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,4), "value">>): The lifetime of the dict values.

Args:

  • value (!lit.ref<_stdlib::_collections::_dict::__DictValueIter<:trait<_stdlib::_collections::_dict::_KeyElement> K, :trait<_stdlib::_builtin::_value::_CollectionElement> V, :_stdlib::_builtin::_bool::_Bool dict_mutability, :lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool dict_mutability, "value">> dict_lifetime, :_stdlib::_builtin::_bool::_Bool {:i1 1}>, mut=#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool mutability, "value">, self_life>): The dict values to get the reversed iterator of.

Returns:

The reversed iterator of the dict values.

reversed[mutability: Bool, self_life: lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,0), "value">>, K: KeyElement, V: CollectionElement, dict_mutability: Bool, dict_lifetime: lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,4), "value">>](value: !lit.ref<_stdlib::_collections::_dict::__DictEntryIter<:trait<_stdlib::_collections::_dict::_KeyElement> K, :trait<_stdlib::_builtin::_value::_CollectionElement> V, :_stdlib::_builtin::_bool::_Bool dict_mutability, :lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool dict_mutability, "value">> dict_lifetime, :_stdlib::_builtin::_bool::_Bool {:i1 1}>, mut=#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool mutability, "value">, self_life>) -> _DictEntryIter[$2, $3, $4, $5, 0]

Get a reversed iterator of the input dict items.

Note: iterators are currently non-raising.

Parameters:

  • mutability (Bool): Whether the reference to the dict is mutable.
  • self_life (lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,0), "value">>): The lifetime of the dict.
  • K (KeyElement): The type of the keys in the dict.
  • V (CollectionElement): The type of the values in the dict.
  • dict_mutability (Bool): Whether the reference to the dict items is mutable.
  • dict_lifetime (lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool *(0,4), "value">>): The lifetime of the dict items.

Args:

  • value (!lit.ref<_stdlib::_collections::_dict::__DictEntryIter<:trait<_stdlib::_collections::_dict::_KeyElement> K, :trait<_stdlib::_builtin::_value::_CollectionElement> V, :_stdlib::_builtin::_bool::_Bool dict_mutability, :lifetime<#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool dict_mutability, "value">> dict_lifetime, :_stdlib::_builtin::_bool::_Bool {:i1 1}>, mut=#lit.struct.extract<:_stdlib::_builtin::_bool::_Bool mutability, "value">, self_life>): The dict items to get the reversed iterator of.

Returns:

The reversed iterator of the dict items.