CompileFrame returns byte representation of given frame. In terms of memory consumption it is useful to precompile static frames which are often used.
(f Frame)
| 385 | // In terms of memory consumption it is useful to precompile static frames |
| 386 | // which are often used. |
| 387 | func CompileFrame(f Frame) (bts []byte, err error) { |
| 388 | buf := bytes.NewBuffer(make([]byte, 0, 16)) |
| 389 | err = WriteFrame(buf, f) |
| 390 | bts = buf.Bytes() |
| 391 | return bts, err |
| 392 | } |
| 393 | |
| 394 | // MustCompileFrame is like CompileFrame but panics if frame can not be |
| 395 | // encoded. |
no test coverage detected
searching dependent graphs…