// FromString loads a template from string and returns a Template instance.
776621
func (set *TemplateSet) FromString(tpl string) (*Template, error) {
	set.firstTemplateCreated = true

	return newTemplateString(set, []byte(tpl))
}
130944
func FromHexStr(str string) (uint8, error) {
	if len(str) == 0 {
		return 0, ErrorEmptyHexStr
	}

	if str[0] == '#' {
		str = str[1:]
	}
	v, err := strconv.ParseUint(str, 16, 24)
	if err != nil {
		return 0, ErrorHexParse
	}
	return FromInt(uint32((v << 8) + 0xFF)), nil
}
94275
func (t *Template) RenderString(context ...interface{}) (string, error) {
	b := &bytes.Buffer{}
	err := t.Render(b, context...)
	return b.String(), err
}
620341
func (cs *CompressionSettings) ToString() string {
	return fmt.Sprintf("%s-q%d", cs.Algorithm.String(), cs.Quality)
}
896812
func (p *DatastorePath) FromString(s string) bool {
	if s == "" {
		return false
	}

	s = strings.TrimSpace(s)

	if !strings.HasPrefix(s, "[") {
		return false
	}

	s = s[1:]

	ix := strings.Index(s, "]")
	if ix < 0 {
		return false
	}

	p.Datastore = s[:ix]
	p.Path = strings.TrimSpace(s[ix+1:])

	return true
}
60986
func (r *SearchRequest) From(from int) *SearchRequest {
	r.searchSource = r.searchSource.From(from)
	return r
}
732473
func fromString(att *design.AttributeDefinition, varName string) string {
	switch att.Type.Kind() {
	case design.BooleanKind:
		return "strconv.ParseBool(" + varName + ")"
	case design.IntegerKind:
		return "strconv.Atoi(" + varName + ")"
	case design.NumberKind:
		return "strconv.ParseFloat(" + varName + ")"
	case design.StringKind:
		return varName + ", (error)(nil)"
	case design.ArrayKind:
	case design.HashKind:
		return valueTypeOf("", att) + "{}, (error)(nil)"
	}
	return "(" + valueTypeOf("", att) + ")(nil), (error)(nil)"
}
333188
func FromString(source string) Query {
	runes := []rune(source)
	len := len(runes)

	return Query{
		Iterate: func() Iterator {
			index := 0

			return func() (item interface{}, ok bool) {
				ok = index < len
				if ok {
					item = runes[index]
					index++
				}

				return
			}
		},
	}
}
864264
func FromHexString(s string) (Multihash, error) {
	b, err := hex.DecodeString(s)
	if err != nil {
		return Multihash{}, err
	}

	return Cast(b)
}
511276
func toString(v reflect.Value) (string, error) {
	switch v.Kind() {
	case reflect.String:
		return v.String(), nil
	case reflect.Interface:
		return toString(v.Elem())
	}
	return "", errors.New("unable to convert value to string")
}
184243
func FromString(input string) (u UUID, err error) {
	err = u.UnmarshalText([]byte(input))
	return
}
364997
func FromString(input string, options ...Options) (string, error) {
	bs := bom.CleanBom([]byte(input))
	text, err := FromReader(bytes.NewReader(bs), options...)
	if err != nil {
		return "", err
	}
	return text, nil
}
29530
func (s *shortcodeTemplates) fromName(name string) (shortcodeVariant, bool) {
	return s.fromVariantsSlice(templateVariants(name))
}
810808
func FromB58String(s string) (m Multihash, err error) {
	b, err := b58.Decode(s)
	if err != nil {
		return Multihash{}, ErrInvalidMultihash
	}

	return Cast(b)
}
1260673
func (v Value) ToString() string {
	if v.typ == Expression {
		return ""
	}
	return hack.String(v.val)
}
877975
func (s *UpdateByQueryService) From(from int) *UpdateByQueryService {
	s.from = &from
	return s
}
974748
func (si *SI) ToString() string {
	defer si.mu.Unlock()
	si.mu.Lock()
	return si.String()
}