// MarshalText implements encoding.TextMarshaler.
195489
func (u UUID) MarshalText() ([]byte, error) {
	if len(u) != 16 {
		return nil, nil
	}
	var js [36]byte
	encodeHex(js[:], u)
	return js[:], nil
}
358511
func (a *MessageImagemapAction) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type ImagemapActionType `json:"type"`
		Text string             `json:"text"`
		Area ImagemapArea       `json:"area"`
	}{
		Type: ImagemapActionTypeMessage,
		Text: a.Text,
		Area: a.Area,
	})
}
861505
func (u Array) MarshalText() ([]byte, error) {
	var js [36]byte
	encodeHex(js[:], u[:])
	return js[:], nil
}
115595
func (n NullDateTime) MarshalJSON() ([]byte, error) {
	if n.Valid {
		return n.DateTime.MarshalJSON()
	}
	return nullText, nil
}
786384
func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error {
	writer := &errWriter{writer: out}
	return m.marshalObject(writer, pb, "")
}
347143
func (f Frame) MarshalText() ([]byte, error) {
	name := f.name()
	if name == "unknown" {
		return []byte(name), nil
	}
	return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil
}
450700
func MarshalText(w io.Writer, pb Message) error {
	return marshalText(w, pb, false)
}
262253
func (b Compatibool) MarshalText() ([]byte, error) {
	if b {
		return []byte("1"), nil
	}
	return []byte("0"), nil
}
914962
func (t UnixTime) MarshalText() ([]byte, error) {
	cast := time.Time(t)
	return cast.MarshalText()
}
1069693
func (p *printer) marshalTextInterface(val encoding.TextMarshaler, start StartElement) error {
	if err := p.writeStart(&start); err != nil {
		return err
	}
	text, err := val.MarshalText()
	if err != nil {
		return err
	}
	EscapeText(p, text)
	return p.writeEnd(start.Name)
}
920079
func (h UnprefixedHash) MarshalText() ([]byte, error) {
	return []byte(hex.EncodeToString(h[:])), nil
}
973891
func (re encodable) MarshalJSON() ([]byte, error) {
	return Encode(re.e, re.obj)
}
487067
func (m AppEUIMetadata) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("AppEUI %s", m.AppEUI)), nil
}
155938
func (m *TextMessage) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type       MessageType      `json:"type"`
		Text       string           `json:"text"`
		QuickReply *QuickReplyItems `json:"quickReply,omitempty"`
	}{
		Type:       MessageTypeText,
		Text:       m.Text,
		QuickReply: m.quickReplyitems,
	})
}
723728
func (b *Board) MarshalText() (text []byte, err error) {
	return []byte(b.String()), nil
}
1042575
func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
	var b bytes.Buffer
	enc := NewEncoder(&b)
	enc.Indent(prefix, indent)
	if err := enc.Encode(v); err != nil {
		return nil, err
	}
	return b.Bytes(), nil
}
289581
func (i *InstanceID) MarshalText() ([]byte, error) {

	t := &bytes.Buffer{}
	fmt.Fprint(t, i.Driver)
	if len(i.Service) > 0 {
		fmt.Fprintf(t, ":%s", i.Service)
	}
	fmt.Fprintf(t, "=%s", i.ID)

	if len(i.Fields) == 0 && len(i.metadata) == 0 {
		return t.Bytes(), nil
	}

	t.WriteByte(',')

	if len(i.Fields) > 0 {
		vals := url.Values{}
		for k, v := range i.Fields {
			vals.Add(k, v)
		}
		t.WriteString(vals.Encode())
	}

	if len(i.metadata) == 0 {
		return t.Bytes(), nil
	}

	t.WriteByte(',')

	enc := b64.NewEncoder(b64.StdEncoding, t)
	if _, err := enc.Write(i.metadata); err != nil {
		return nil, err
	}
	if err := enc.Close(); err != nil {
		return nil, err
	}
	return t.Bytes(), nil
}