func (t *MockRPCResult) Read(decoder tl.Decoder, waitress tl.Waitress, bind_uuid uuid.UUID) (err error) {
	val0 := &t.Arg

	h0, err := decoder.ReadTypeBegin()
	if err != nil {
		return err
	}
	if h0 != builtin.TL_ID_VECTOR_T {
		return fmt.Errorf("bad vector crc %0x08d", h0)
	}

	n0, err := decoder.ReadInt()
	if err != nil {
		return err
	}

	for i0 := 0; i0 < int(n0); i0++ {
		val1 := new(int32)
		if *val1, err = decoder.ReadInt(); err != nil {
			return err
		}
		*val0 = append(*val0, *val1)
	}
	if len(*val0) != int(n0) {
		return fmt.Errorf("bad multi size %d != %d", n0, len(*val0))
	}
	return
}
Example #2
0
func (t *RpcError) Read(decoder tl.Decoder, waitress tl.Waitress, bind_uuid uuid.UUID) (err error) {
	t.ErrorCode, err = decoder.ReadInt()
	if err != nil {
		return
	}
	t.ErrorMessage, err = decoder.ReadString()
	return
}
Example #3
0
func (t *Int) Read(decoder tl.Decoder, waitress tl.Waitress, bind_uuid uuid.UUID) (err error) {
	t.value, err = decoder.ReadInt()
	return
}