Encode encodes the given values to the underlying reader. All written values are aligned properly as required by the D-Bus spec.
(vs ...any)
| 68 | // Encode encodes the given values to the underlying reader. All written values |
| 69 | // are aligned properly as required by the D-Bus spec. |
| 70 | func (enc *encoder) Encode(vs ...any) (err error) { |
| 71 | defer func() { |
| 72 | err, _ = recover().(error) |
| 73 | }() |
| 74 | for _, v := range vs { |
| 75 | enc.encode(reflect.ValueOf(v), 0) |
| 76 | } |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | // encode encodes the given value to the writer and panics on error. depth holds |
| 81 | // the depth of the container nesting. |