// GetFrom returns the From field if it's non-nil, zero value otherwise.
764734
func (r *Rename) GetFrom() string {
	if r == nil || r.From == nil {
		return ""
	}
	return *r.From
}
1306353
func (i *VInt) ReadFrom(r Reader, l int) error {
	var v VInt
	b, err := r.ReadByte()
	if err != nil {
		return errorsp.WithStacks(err)
	}
	v = VInt(b & 0x7f)
	for n := uint(7); b&0x80 != 0; n += 7 {
		if b, err = r.ReadByte(); err != nil {
			if errorsp.Cause(err) == io.EOF {
				return errorsp.WithStacks(io.ErrUnexpectedEOF)
			}
			return errorsp.WithStacks(err)
		}
		v |= VInt(b&0x7f) << n
	}
	*i = v
	return nil
}
118665
func (s *Range) SetFrom(v int64) *Range {
	s.From = &v
	return s
}
455677
func (i *InstructionWriteActions) ReadFrom(r io.Reader) (int64, error) {
	return readInstructionActions(r, &i.Actions)
}
1167027
func (s *NotifyConfigurationType) SetFrom(v string) *NotifyConfigurationType {
	s.From = &v
	return s
}
157533
func (e *scriptEntry) ReadFrom(r io.Reader) (n int64, err error) {
	var read int64

	if read, err = binaryRead(r, binary.LittleEndian, &e.scriptHash160); err != nil {
		return n + read, err
	}
	n += read

	read, err = e.script.ReadFrom(r)
	return n + read, err
}
14626
func (q *QueueStatsRequest) ReadFrom(r io.Reader) (int64, error) {
	return encoding.ReadFrom(r, &q.Port, &q.Queue)
}
766179
func (s *ExportTask) SetFrom(v int64) *ExportTask {
	s.From = &v
	return s
}
1224704
func (s *RawString) ReadFrom(r Reader, l int) error {
	var ba RawByteSlice
	if err := ba.ReadFrom(r, l); err != nil {
		return err
	}
	*s = RawString(ba)

	return nil
}
670076
func (t *TableFeatures) ReadFrom(r io.Reader) (int64, error) {
	var name [maxTableNameLen]byte
	var length uint16

	n, err := encoding.ReadFrom(r, &length, &t.Table,
		&defaultPad5, &name, &t.MetadataMatch, &t.MetadataWrite,
		&t.Config, &t.MaxEntries)

	if err != nil {
		return n, err
	}

	t.Name = string(name[:])
	t.Properties = nil

	var tablePropType TablePropType

	rm := func() (io.ReaderFrom, error) {
		if rm, ok := tablePropMap[tablePropType]; ok {
			rd, err := rm.MakeReader()
			t.Properties = append(t.Properties, rd.(TableProp))
			return rd, err
		}

		return nil, fmt.Errorf("ofp: unknown table property type: %s", tablePropType)
	}

	limrd := io.LimitReader(r, int64(length)-n)
	nn, err := encoding.ScanFrom(limrd, &tablePropType,
		encoding.ReaderMakerFunc(rm))

	return n + nn, err
}
497645
func (Null) ReadFrom(r Reader, l int) error {
	if l != UNKNOWN_LEN && l != 0 {
		return errorsp.WithStacksAndMessage(ErrBadFormat, "l = %d", l)
	}
	return nil
}
1354603
func getValueFromFields(value reflect.Value, fieldNames []string) (results []interface{}) {
	// If value is a nil pointer, Indirect returns a zero Value!
	// Therefor we need to check for a zero value,
	// as FieldByName could panic
	if indirectValue := reflect.Indirect(value); indirectValue.IsValid() {
		for _, fieldName := range fieldNames {
			if fieldValue := reflect.Indirect(indirectValue.FieldByName(fieldName)); fieldValue.IsValid() {
				result := fieldValue.Interface()
				if r, ok := result.(driver.Valuer); ok {
					result, _ = r.Value()
				}
				results = append(results, result)
			}
		}
	}
	return
}
1372824
func (a *ActionSetNetworkTTL) ReadFrom(r io.Reader) (int64, error) {
	return encoding.ReadFrom(r, &defaultPad4, &a.TTL, &defaultPad3)
}
1090477
func (h *DBHashes) readFrom(r io.Reader) error {
	return binary.Read(r, binary.LittleEndian, h)
}
127298
func (i *Int32) ReadFrom(r Reader, l int) error {
	if l != UNKNOWN_LEN && l != 4 {
		return errorsp.WithStacksAndMessage(ErrBadFormat, "l = %d", l)
	}

	var arr [4]byte
	if _, err := io.ReadFull(r, arr[:]); err != nil {
		return errorsp.WithStacks(err)
	}
	*i = Int32(arr[0]) | Int32(arr[1])<<8 | Int32(arr[2])<<16 |
		Int32(arr[3])<<24
	return nil
}
1106715
func (s *Slice) readFrom(r io.Reader) error {
	er := errorReader{r: r}
	s.refID = er.itf8()
	s.start = er.itf8()
	s.span = er.itf8()
	s.nRec = er.itf8()
	s.recCount = er.ltf8()
	s.blocks = er.itf8()
	s.blockIDs = er.itf8slice()
	s.embeddedRefID = er.itf8()
	_, err := io.ReadFull(&er, s.md5sum[:])
	if err != nil {
		return err
	}
	s.tags, err = ioutil.ReadAll(&er)
	return err
}
278710
func (t *TablePropExperimenter) ReadFrom(r io.Reader) (int64, error) {
	var header tableProp

	n, err := encoding.ReadFrom(r, &header, &t.Experimenter, &t.ExpType)
	if err != nil {
		return n, err
	}

	limrd := io.LimitReader(r, int64(header.Len-tablePropLen-8))
	t.Data, err = ioutil.ReadAll(limrd)
	n += int64(len(t.Data))

	if err != nil {
		return n, err
	}

	padding := make([]byte, (header.Len+7)/8*8-header.Len)
	nn, err := encoding.ReadFrom(r, padding)

	return n + nn, err
}