pw: loop: Replace `IsLoop` trait with `AsRef<LoopRef>` and `Deref` implementations, make `Loop` refcounted.
The trait IsLoop
was defined exactly like AsRef<LoopRef>
is, and did exactyl what AsRef
does:
Convert a reference to an owned type to a reference type.
Therefore we can just implement the AsRef
trait instead.
The commit also makes the Loop
trait refcounted.
The pipewire C lib does not refcount these types, but we rust bindings require refcounting for its safe interface.
The Loop
struct not being refcounted meant that it could not be used with the Context
struct,
which was an oversight in its initial implementation, so this commit also fixes that.