webrtc: SessionDescription: access the inner SDPMessage as & or &mut
Loading
Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
The migration is almost done, at least the rest should happen in the background. There are still a few technical difference between the old cluster and the new ones, and they are summarized in this issue. Please pay attention to the TL:DR at the end of the comment.
WebRTCSessionDescription
owns its SDPMessage
. The sdp()
accessor used to
return a copy of the SDPMessage
which prevented the user from getting a ref
and by extension from getting a mutable ref for in-place modification.
This commit makes the accessor return a reference to the inner SDPMessage
and
adds a mutable accessor.
Previous behaviour (getting an owned copy of the SDPMessage
) is available by
calling to_owned()
on the reference returned by sdp()
.
Users who wish to change the type of WebRTCSessionDescription
can call
set_type()
.