//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// StarGiftAttributeRarityClassArray is adapter for slice of StarGiftAttributeRarityClass.
type StarGiftAttributeRarityClassArray []StarGiftAttributeRarityClass

// Sort sorts slice of StarGiftAttributeRarityClass.
func ( StarGiftAttributeRarityClassArray) ( func(,  StarGiftAttributeRarityClass) bool) StarGiftAttributeRarityClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of StarGiftAttributeRarityClass.
func ( StarGiftAttributeRarityClassArray) ( func(,  StarGiftAttributeRarityClass) bool) StarGiftAttributeRarityClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of StarGiftAttributeRarityClass.
func ( StarGiftAttributeRarityClassArray) ( func( StarGiftAttributeRarityClass) bool) StarGiftAttributeRarityClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( StarGiftAttributeRarityClassArray) () ( StarGiftAttributeRarityClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( StarGiftAttributeRarityClassArray) () ( StarGiftAttributeRarityClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *StarGiftAttributeRarityClassArray) () ( StarGiftAttributeRarityClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  StarGiftAttributeRarityClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *StarGiftAttributeRarityClassArray) () ( StarGiftAttributeRarityClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsStarGiftAttributeRarity returns copy with only StarGiftAttributeRarity constructors.
func ( StarGiftAttributeRarityClassArray) () ( StarGiftAttributeRarityArray) {
	for ,  := range  {
		,  := .(*StarGiftAttributeRarity)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// StarGiftAttributeRarityArray is adapter for slice of StarGiftAttributeRarity.
type StarGiftAttributeRarityArray []StarGiftAttributeRarity

// Sort sorts slice of StarGiftAttributeRarity.
func ( StarGiftAttributeRarityArray) ( func(,  StarGiftAttributeRarity) bool) StarGiftAttributeRarityArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of StarGiftAttributeRarity.
func ( StarGiftAttributeRarityArray) ( func(,  StarGiftAttributeRarity) bool) StarGiftAttributeRarityArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of StarGiftAttributeRarity.
func ( StarGiftAttributeRarityArray) ( func( StarGiftAttributeRarity) bool) StarGiftAttributeRarityArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( StarGiftAttributeRarityArray) () ( StarGiftAttributeRarity,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( StarGiftAttributeRarityArray) () ( StarGiftAttributeRarity,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *StarGiftAttributeRarityArray) () ( StarGiftAttributeRarity,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  StarGiftAttributeRarity
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *StarGiftAttributeRarityArray) () ( StarGiftAttributeRarity,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}