// WithFallbackMarshalerUnmarshaler returns a new copy of the options with the
// FallbackMarshalerUnmarshaler property set to the given value. It does not
// mutate the original options.
340025
func (options CollectionOptions) WithFallbackMarshalerUnmarshaler(fallback MarshalerUnmarshaler) CollectionOptions {
	options.FallbackMarshalerUnmarshaler = fallback
	return options
}
911664
func (l *Locale) UnmarshalBinary(data []byte) error {
	buff := bytes.NewBuffer(data)
	obj := new(LocaleEncoding)

	decoder := gob.NewDecoder(buff)
	err := decoder.Decode(obj)
	if err != nil {
		return err
	}

	l.defaultDomain = obj.DefaultDomain
	l.lang = obj.Lang
	l.path = obj.Path

	// Decode Domains
	l.Domains = make(map[string]Translator)
	for k, v := range obj.Domains {
		var tr TranslatorEncoding
		buff := bytes.NewBuffer(v)
		trDecoder := gob.NewDecoder(buff)
		err := trDecoder.Decode(&tr)
		if err != nil {
			return err
		}

		l.Domains[k] = tr.GetTranslator()
	}

	return nil
}
491158
func (dc *DefinitionChoice) UnmarshalYAML(unmarshaler func(interface{}) error) error {

	simpleDefinition := new(string)
	parameterizedDefinition := make(map[string]DefinitionParameters)

	var err error

	// Unmarshal into a string
	if err = unmarshaler(simpleDefinition); err == nil {
		dc.Name = *simpleDefinition
		dc.Parameters = nil
	} else if err = unmarshaler(parameterizedDefinition); err == nil {
		// Didn't work? Now unmarshal into a map
		for choice, params := range parameterizedDefinition {
			dc.Name = choice
			dc.Parameters = params
		}
	}

	// Still didn't work? Panic

	return err
}
474980
func (v *Value) UnmarshalBinary(data []byte) error {
	reader := bytes.NewReader(data)

	b, err := reader.ReadByte()
	if err != nil {
		return err
	}

	typ := ValueType(b)
	if typ == NullType {
		*v = Value{}
		return nil
	}

	length, err := binary.ReadUvarint(reader)
	if err != nil {
		return err
	}

	raw := make([]byte, length)
	n, err := reader.Read(raw)
	if err != nil {
		return err
	}

	if uint64(n) != length {
		return errors.Newf("Not enough bytes to read Value")
	}

	switch typ {
	case NumericType:
		*v = Value{Numeric(raw)}
	case FractionalType:
		*v = Value{Fractional(raw)}
	case StringType:
		*v = Value{String{raw, false}}
	case UTF8StringType:
		*v = Value{String{raw, true}}
	default:
		return errors.Newf("Unknown type %d", int(typ))
	}

	return nil
}
898361
func (customCodec) Unmarshal(data []byte, obj interface{}) error {
	switch value := obj.(type) {
	case *[]byte:
		*value = data
		return nil
	default:
		return newCustomCodecUnmarshalCastError(obj)
	}
}
485492
func (r *RequestOpen) UnmarshalBinary(data []byte) error {
	return UnmarshalBinary(data, &r.Request, &r.OpenMode, &r.OpenFlags, &r.Permissions, &r.FileName)
}
3745
func (h *HLL) UnmarshalBinary(data []byte) error {
	var s serializable
	err := gob.NewDecoder(bytes.NewReader(data)).Decode(&s)
	if err != nil {
		return err
	}
	h.P = s.P
	h.m1 = s.M1
	h.m2 = s.M2
	h.alpha = s.Alpha
	h.format = s.Format
	h.tempSet = &s.TempSet
	h.sparseList = &s.SparseList
	h.registers = s.Registers

	if h.Hasher == nil {
		h.Hasher = MMH3Hash
	}
	return nil
}
647332
func (p *FragSessionDeleteAnsPayload) UnmarshalBinary(data []byte) error {
	if len(data) < p.Size() {
		return fmt.Errorf("lorawan/applayer/fragmentation: %d byte is expected", p.Size())
	}

	p.Status.FragIndex = data[0] & 0x03
	p.Status.SessionDoesNotExist = data[0]&0x04 != 0

	return nil
}
1001206
func (h *TLFReaderKeyBundleID) UnmarshalBinary(data []byte) error {
	return h.h.UnmarshalBinary(data)
}
988953
func (o *ValidUntilOption) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		o.value = time.Time{}
		return nil
	}
	return json.Unmarshal(data, &o.value)
}
561531
func (o *DistinctOption) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		return nil
	}

	var i int
	if err := json.Unmarshal(data, &i); err == nil {
		o.value = i
		return nil
	}

	var b bool
	if err := json.Unmarshal(data, &b); err == nil {
		if b {
			o.value = 1
		} else {
			o.value = 0
		}
		return nil
	}

	return errs.ErrJSONDecode(data, "Distinct")
}
97655
func (o *OptionCodes) UnmarshalBinary(p []byte) error {
	b := uio.NewBigEndianBuffer(p)
	*o = make(OptionCodes, 0, b.Len())
	for b.Has(1) {
		*o = append(*o, dhcp4.OptionCode(b.Read8()))
	}
	return b.FinError()
}
1249398
func (v *mvccValue) UnmarshalBinary(data []byte) error {
	var mh marshalHelper
	buf := bytes.NewBuffer(data)
	var vt int64
	mh.ReadNumber(buf, &vt)
	v.valueType = mvccValueType(vt)
	mh.ReadNumber(buf, &v.startTS)
	mh.ReadNumber(buf, &v.commitTS)
	mh.ReadSlice(buf, &v.value)
	return errors.Trace(mh.err)
}
808456
func (o *TypoToleranceOption) UnmarshalJSON(data []byte) error {
	if string(data) == "null" {
		o.value = typoToleranceTrue
		return nil
	}

	var v string
	if err := json.Unmarshal(data, &v); err == nil {
		o.value = v
		return nil
	}

	var b bool
	if err := json.Unmarshal(data, &b); err == nil {
		o.value = fmt.Sprintf("%t", b)
		return nil
	}

	return errs.ErrJSONDecode(data, "TypoTolerance")
}
138664
func (n *DevNonce) UnmarshalBinary(data []byte) error {
	if len(data) != 2 {
		return errors.New("lorawan: 2 bytes are expected")
	}
	*n = DevNonce(binary.LittleEndian.Uint16(data))
	return nil
}
1243292
func (r *RelayMessageOption) UnmarshalBinary(b []byte) error {
	*r = make([]byte, len(b))
	copy(*r, b)
	return nil
}
684390
func (c *Config) Unmarshal(b []byte) error {
	r := bytes.NewBuffer(b)
	d := format.NewDecoder(r)

	c.Raw = format.New()
	if err := d.Decode(c.Raw); err != nil {
		return err
	}

	c.unmarshalCore()
	if err := c.unmarshalPack(); err != nil {
		return err
	}
	unmarshalSubmodules(c.Raw, c.Submodules)

	if err := c.unmarshalBranches(); err != nil {
		return err
	}

	return c.unmarshalRemotes()
}