strs

package
v0.0.0-...-9bbed00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnsafeBytes

func UnsafeBytes(s string) (b []byte)

UnsafeBytes returns an unsafe bytes slice reference of s. The caller must treat returned slice as immutable.

WARNING: Use carefully. The returned result must not leak to the end user.

func UnsafeString

func UnsafeString(b []byte) (s string)

UnsafeString returns an unsafe string reference of b. The caller must treat the input slice as immutable.

WARNING: Use carefully. The returned result must not leak to the end user unless the input slice is provably immutable.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds a set of strings with shared lifetime. This differs from strings.Builder, which is for building a single string.

func (*Builder) AppendFullName

func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName

AppendFullName is equivalent to protoreflect.FullName.Append, but optimized for large batches where each name has a shared lifetime.

func (*Builder) MakeString

func (sb *Builder) MakeString(b []byte) string

MakeString is equivalent to string(b), but optimized for large batches with a shared lifetime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL