internal/pipewire: implement footer
All checks were successful
Test / Create distribution (push) Successful in 39s
Test / Sandbox (push) Successful in 2m26s
Test / Hakurei (push) Successful in 3m19s
Test / Hpkg (push) Successful in 4m13s
Test / Sandbox (race detector) (push) Successful in 4m25s
Test / Hakurei (race detector) (push) Successful in 5m15s
Test / Flake checks (push) Successful in 1m39s
All checks were successful
Test / Create distribution (push) Successful in 39s
Test / Sandbox (push) Successful in 2m26s
Test / Hakurei (push) Successful in 3m19s
Test / Hpkg (push) Successful in 4m13s
Test / Sandbox (race detector) (push) Successful in 4m25s
Test / Hakurei (race detector) (push) Successful in 5m15s
Test / Flake checks (push) Successful in 1m39s
The POD itself is serialised without requiring a special case, however its presence is only indicated by the difference in size recorded in the header and payload. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
463f8836e6
commit
05391da556
@ -386,6 +386,24 @@ func unmarshalCheckTypeBounds(data *[]byte, t Word, sizeP *Word) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The Footer contains additional messages, not directed to
|
||||||
|
// the destination object defined by the Id field.
|
||||||
|
type Footer[T any] struct {
|
||||||
|
// The footer opcode.
|
||||||
|
Opcode Id
|
||||||
|
// The footer payload struct.
|
||||||
|
Payload T
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary satisfies [encoding.BinaryMarshaler] via [Marshal].
|
||||||
|
func (f *Footer[T]) MarshalBinary() ([]byte, error) { return Marshal(f) }
|
||||||
|
|
||||||
|
// UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal].
|
||||||
|
func (f *Footer[T]) UnmarshalBinary(data []byte) error {
|
||||||
|
_, err := Unmarshal(data, f)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// SPADictItem is an encoding-compatible representation of spa_dict_item.
|
// SPADictItem is an encoding-compatible representation of spa_dict_item.
|
||||||
type SPADictItem struct{ Key, Value string }
|
type SPADictItem struct{ Key, Value string }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user