internal/pipewire: implement Registry::Bind
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m27s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 4m5s
Test / Sandbox (race detector) (push) Successful in 4m21s
Test / Hakurei (race detector) (push) Successful in 5m10s
Test / Flake checks (push) Successful in 1m30s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m27s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 4m5s
Test / Sandbox (race detector) (push) Successful in 4m21s
Test / Hakurei (race detector) (push) Successful in 5m10s
Test / Flake checks (push) Successful in 1m30s
This change also adds test cases for messages before this one. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -265,3 +265,33 @@ func (c *RegistryGlobal) MarshalBinary() ([]byte, error) { return Marshal(c) }
|
||||
|
||||
// UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal].
|
||||
func (c *RegistryGlobal) UnmarshalBinary(data []byte) error { return Unmarshal(data, c) }
|
||||
|
||||
// RegistryBind is sent when the client requests to bind to the
|
||||
// global object with id and use the client proxy with new_id as
|
||||
// the proxy. After this call, methods can be sent to the remote
|
||||
// global object and events can be received.
|
||||
type RegistryBind struct {
|
||||
// The [RegistryGlobal.ID] to bind to.
|
||||
ID Int `json:"id"`
|
||||
// the [RegistryGlobal.Type] of the global id.
|
||||
Type String `json:"type"`
|
||||
// The client version of the interface for type.
|
||||
Version Int `json:"version"`
|
||||
// The client proxy id for the global object.
|
||||
NewID Int `json:"new_id"`
|
||||
}
|
||||
|
||||
// Size satisfies [KnownSize] with a value computed at runtime.
|
||||
func (c *RegistryBind) Size() Word {
|
||||
return SizePrefix +
|
||||
Size(SizeInt) +
|
||||
SizeString[Word](c.Type) +
|
||||
Size(SizeInt) +
|
||||
Size(SizeInt)
|
||||
}
|
||||
|
||||
// MarshalBinary satisfies [encoding.BinaryMarshaler] via [Marshal].
|
||||
func (c *RegistryBind) MarshalBinary() ([]byte, error) { return Marshal(c) }
|
||||
|
||||
// UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal].
|
||||
func (c *RegistryBind) UnmarshalBinary(data []byte) error { return Unmarshal(data, c) }
|
||||
|
||||
Reference in New Issue
Block a user