// 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{}
)

// Double represents TL type `double#2210c154`.
//
// See https://core.telegram.org/constructor/double for reference.
type Double struct {
}

// DoubleTypeID is TL type id of Double.
const DoubleTypeID = 0x2210c154

// Ensuring interfaces in compile-time for Double.
var (
	_ bin.Encoder     = &Double{}
	_ bin.Decoder     = &Double{}
	_ bin.BareEncoder = &Double{}
	_ bin.BareDecoder = &Double{}
)

func ( *Double) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *Double) () string {
	if  == nil {
		return "Double(nil)"
	}
	type  Double
	return fmt.Sprintf("Double%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Double) () uint32 {
	return DoubleTypeID
}

// TypeName returns name of type in TL schema.
func (*Double) () string {
	return "double"
}

// TypeInfo returns info about TL type.
func ( *Double) () tdp.Type {
	 := tdp.Type{
		Name: "double",
		ID:   DoubleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *Double) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode double#2210c154 as nil")
	}
	.PutID(DoubleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *Double) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode double#2210c154 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *Double) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode double#2210c154 to nil")
	}
	if  := .ConsumeID(DoubleTypeID);  != nil {
		return fmt.Errorf("unable to decode double#2210c154: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *Double) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode double#2210c154 to nil")
	}
	return nil
}