import "github.com/tsavola/wag/buffer"
Package buffer implements compile.CodeBuffer and compile.DataBuffer.
dynamic.go limited.go sizeerror.go static.go
type Dynamic struct {
// contains filtered or unexported fields
}
Dynamic is a variable-capacity buffer. The default value is a valid buffer.
MakeDynamic buffer.
This function can be used in field initializer expressions. The initialized field must not be copied.
MakeDynamicHint avoids making excessive allocations if the maximum buffer size can be estimated in advance. The slice must be empty.
This function can be used in field initializer expressions. The initialized field must not be copied.
NewDynamic buffer.
NewDynamicHint avoids making excessive allocations if the maximum buffer size can be estimated in advance. The slice must be empty.
Bytes doesn't panic.
Extend doesn't panic unless out of memory.
Len doesn't panic.
PutBytes doesn't panic unless out of memory.
Extend doesn't panic unless out of memory.
ResizeBytes doesn't panic unless out of memory.
type Limited struct {
// contains filtered or unexported fields
}
Limited is a dynamic buffer with a maximum size. The default value is an empty buffer that cannot grow.
MakeLimited buffer with a maximum size. The slice must be empty.
This function can be used in field initializer expressions. The initialized field must not be copied.
NewLimited buffer with a maximum size. The slice must be empty.
Bytes doesn't panic.
Extend panicks with ErrSizeLimit if n bytes cannot be appended to the buffer.
Len doesn't panic.
PutByte panicks with ErrSizeLimit if the buffer is already full.
Extend panicks with ErrSizeLimit if 4 bytes cannot be appended to the buffer.
ResizeBytes panicks with ErrSizeLimit if n is larger than maximum buffer size.
type Static struct {
// contains filtered or unexported fields
}
Static is a fixed-capacity buffer, for wrapping a memory-mapped region. The default value is a zero-capacity buffer.
MakeStatic buffer.
This function can be used in field initializer expressions. The initialized field must not be copied.
NewStatic buffer.
Bytes doesn't panic.
Capacity of the static buffer.
Extend panicks with ErrSizeLimit if n bytes cannot be appended to the buffer.
Len doesn't panic.
PutByte panicks with ErrSizeLimit if the buffer is already full.
Extend panicks with ErrSizeLimit if 4 bytes cannot be appended to the buffer.
ResizeBytes panicks with ErrSizeLimit if n is larger than buffer capacity.
Write doesn't panic.
Package buffer imports 3 packages (graph) and is imported by 3 packages. Updated 2019-11-15. Refresh now. Tools for package owners.