// MarshalText implements the encoding.TextMarshaler interface
421641
func (m PrefixMetadata) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("Prefix %s", m.Prefix)), nil
}
971967
func (t Time) MarshalText() (text []byte, err error) {
	return t.Time.MarshalText()
}
656034
func (tm *TextMarshaler) Text(pb Message) string {
	var buf bytes.Buffer
	tm.Marshal(&buf, pb)
	return buf.String()
}
450700
func MarshalText(w io.Writer, pb Message) error {
	return marshalText(w, pb, false)
}
1151107
func (c *Constraint) MarshalText() (text []byte, err error) {
	return []byte(c.String()), nil
}
1142562
func (s DLSettings) MarshalText() ([]byte, error) {
	b, err := s.MarshalBinary()
	if err != nil {
		return nil, err
	}

	return []byte(hex.EncodeToString(b)), nil
}
76162
func (tf timeFormat) MarshalText() (text []byte, err error) {
	// The following code adapted from the standard library time.Time.Format
	// method. Using the same undocumented magic constant to extend the size
	// of the buffer as seen there.
	b := make([]byte, 0, len(tf.layout)+10)
	b = tf.time.AppendFormat(b, tf.layout)
	return b, nil
}
950585
func MarshalString(v interface{}) (string, error) {
	vals, err := Marshal(v)
	if err != nil {
		return "", err
	}
	return vals.Encode(), nil
}
861505
func (u Array) MarshalText() ([]byte, error) {
	var js [36]byte
	encodeHex(js[:], u[:])
	return js[:], nil
}
805388
func (v ExceptionType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("UNKNOWN"), nil
	case 1:
		return []byte("UNKNOWN_METHOD"), nil
	case 2:
		return []byte("INVALID_MESSAGE_TYPE"), nil
	case 3:
		return []byte("WRONG_METHOD_NAME"), nil
	case 4:
		return []byte("BAD_SEQUENCE_ID"), nil
	case 5:
		return []byte("MISSING_RESULT"), nil
	case 6:
		return []byte("INTERNAL_ERROR"), nil
	case 7:
		return []byte("PROTOCOL_ERROR"), nil
	case 8:
		return []byte("INVALID_TRANSFORM"), nil
	case 9:
		return []byte("INVALID_PROTOCOL"), nil
	case 10:
		return []byte("UNSUPPORTED_CLIENT_TYPE"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}
12827
func MarshalTextString(pb Message) string {
	var buf bytes.Buffer
	marshalText(&buf, pb, false)
	return buf.String()
}
353977
func (i HexOrDecimal64) MarshalText() ([]byte, error) {
	return []byte(fmt.Sprintf("%#x", uint64(i))), nil
}
1167472
func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
	return ConfigDefault.MarshalIndent(v, prefix, indent)
}
1218638
func MarshalContext(ctx context.Context) map[string]interface{} {
	contextMarshalFuncsMu.RLock()
	defer contextMarshalFuncsMu.RUnlock()

	allVals := map[string]interface{}{}

	for _, f := range contextMarshalFuncs {
		vals := map[string]interface{}{}
		f(ctx, vals)

		for key, val := range vals {
			if _, ok := allVals[key]; ok {
				panic("duplicate context entry for: " + key)
			}
			allVals[key] = val
		}
	}

	return allVals
}
1298808
func (a *Accelerator) MarshalText() ([]byte, error) {
	return []byte(strings.Join(*a, acceleratorSeparator)), nil
}
11699
func (g *Game) MarshalText() (text []byte, err error) {
	return []byte(encodePGN(g)), nil
}
855371
func (t Time) MarshalText() ([]byte, error) {
	return []byte(t.Time.UTC().Format(time.RFC3339Nano)), nil
}