// MarshalVPack returns m as the Velocypack encoding of m.
421684
func (r RawObject) MarshalVPack() (velocypack.Slice, error) {
	if r == nil {
		return velocypack.NullSlice(), nil
	}
	return velocypack.Slice(r), nil
}
788198
func (bv *Value) MarshalJSON() ([]byte, error) {
	return []byte("\"" + base64.RawURLEncoding.EncodeToString(*bv) + "\""), nil
}
878650
func (u UUID) MarshalText() (text []byte, err error) {
	text = []byte(u.String())
	return
}
233839
func (c Code) MarshalText() ([]byte, error) {
	s, ok := _codeToString[c]
	if ok {
		return []byte(s), nil
	}
	return nil, fmt.Errorf("unknown code: %d", int(c))
}
991492
func (z Keys) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	o = msgp.AppendArrayHeader(o, uint32(len(z)))
	for xvk := range z {
		if z[xvk] == nil {
			o = msgp.AppendNil(o)
		} else {
			o, err = z[xvk].MarshalMsg(o)
			if err != nil {
				return
			}
		}
	}
	return
}
527375
func (c Call) MarshalText() ([]byte, error) {
	if c.frame == (runtime.Frame{}) {
		return nil, ErrNoFunc
	}

	buf := bytes.Buffer{}
	fmt.Fprint(&buf, c)
	return buf.Bytes(), nil
}
421641
func (m PrefixMetadata) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("Prefix %s", m.Prefix)), nil
}
260582
func Marshal(layers Layers) ([]byte, error) {
	vt := &vectortile.Tile{
		Layers: make([]*vectortile.Tile_Layer, 0, len(layers)),
	}

	for _, l := range layers {
		v := l.Version
		e := l.Extent
		layer := &vectortile.Tile_Layer{
			Name:     &l.Name,
			Version:  &v,
			Extent:   &e,
			Features: make([]*vectortile.Tile_Feature, 0, len(l.Features)),
		}

		kve := newKeyValueEncoder()
		for i, f := range l.Features {
			t, g, err := encodeGeometry(f.Geometry)
			if err != nil {
				return nil, errors.WithMessage(err, fmt.Sprintf("layer %s: feature %d: error encoding geometry", l.Name, i))
			}

			tags, err := encodeProperties(kve, f.Properties)
			if err != nil {
				return nil, errors.WithMessage(err, fmt.Sprintf("layer %s: feature %d: error encoding properties", l.Name, i))
			}

			layer.Features = append(layer.Features, &vectortile.Tile_Feature{
				Id:       convertID(f.ID),
				Tags:     tags,
				Type:     &t,
				Geometry: g,
			})
		}

		layer.Keys = kve.Keys
		layer.Values = kve.Values

		vt.Layers = append(vt.Layers, layer)
	}

	return proto.Marshal(vt)
}
611547
func Marshal(v interface{}) ([]byte, error) {
	var buf bytes.Buffer
	e := Encoder{w: &buf}
	err := e.Encode(v)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
1115025
func Marshal(v interface{}) ([]byte, error) {
	w := bytes.NewBuffer(nil)
	err := MarshalTo(w, v)
	return w.Bytes(), err
}
1149232
func (customCodec) Marshal(obj interface{}) ([]byte, error) {
	switch value := obj.(type) {
	case []byte:
		return value, nil
	default:
		return nil, newCustomCodecMarshalCastError(obj)
	}
}
1309813
func (u UUID) MarshalText() ([]byte, error) {
	text := make([]byte, 24)
	base64.StdEncoding.Encode(text, u[:])
	return text, nil
}
508831
func (e encodable) MarshalJSON() ([]byte, error) {
	return Encode(e.E, e.obj)
}
85315
func (t *Array) MarshalJSON() ([]byte, error) {
	repr := map[string]interface{}{
		"type": t.typeMarker(),
	}
	if len(t.static) != 0 {
		repr["static"] = t.static
	}
	if t.dynamic != nil {
		repr["dynamic"] = t.dynamic
	}
	return json.Marshal(repr)
}
550927
func Marshal(v interface{}) ([]byte, error) {
	buf := bytes.Buffer{}
	enc := NewEncoder(&buf)
	err := enc.Encode(v)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
135868
func (m *Modules) Marshal() ([]byte, error) {
	s := m.raw.Section(submoduleSection)
	s.Subsections = make(format.Subsections, len(m.Submodules))

	var i int
	for _, r := range m.Submodules {
		s.Subsections[i] = r.marshal()
		i++
	}

	buf := bytes.NewBuffer(nil)
	if err := format.NewEncoder(buf).Encode(m.raw); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}
168568
func (s *FixedSchema) MarshalJSON() ([]byte, error) {
	return json.Marshal(struct {
		Type string `json:"type,omitempty"`
		Size int    `json:"size,omitempty"`
		Name string `json:"name,omitempty"`
	}{
		Type: "fixed",
		Size: s.Size,
		Name: s.Name,
	})
}