pub struct SetupCapabilities { /* private fields */ }Expand description
DTLS roles the local handshake implementation can hold.
Kept in the SDP crate because offer/answer has to refuse an impossible role before a media
worker starts. It describes capability only; sockets and handshakes remain in sipx-media.
Implementations§
Source§impl SetupCapabilities
impl SetupCapabilities
Sourcepub const fn both() -> Self
pub const fn both() -> Self
Both DTLS roles, which the default handshake implementation supports.
Sourcepub const fn client_only() -> Self
pub const fn client_only() -> Self
Only the active/client role.
Sourcepub const fn server_only() -> Self
pub const fn server_only() -> Self
Only the passive/server role.
Sourcepub const fn neither() -> Self
pub const fn neither() -> Self
No usable DTLS role. Useful for representing a feature or adapter that is unavailable.
Sourcepub fn answer_to(self, offered: Setup) -> Result<Setup, SetupRoleError>
pub fn answer_to(self, offered: Setup) -> Result<Setup, SetupRoleError>
Select the answer to an offered setup value.
actpass prefers active, as RFC 5763 §5 recommends, but a server-only implementation may
legally select passive. A fixed offer can be answered only with its complement.
§Errors
Returns SetupRoleError when this endpoint cannot hold the required role.
Sourcepub fn from_answer(
self,
answered: Option<Setup>,
) -> Result<Setup, SetupRoleError>
pub fn from_answer( self, answered: Option<Setup>, ) -> Result<Setup, SetupRoleError>
Resolve this offerer’s local role from the answer.
§Errors
Returns a typed refusal for a missing or unresolved answer and when the complementary role is not available locally. No caller needs to start a handshake to discover this.
Trait Implementations§
Source§impl Clone for SetupCapabilities
impl Clone for SetupCapabilities
Source§fn clone(&self) -> SetupCapabilities
fn clone(&self) -> SetupCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SetupCapabilities
impl Debug for SetupCapabilities
Source§impl Default for SetupCapabilities
impl Default for SetupCapabilities
Source§impl PartialEq for SetupCapabilities
impl PartialEq for SetupCapabilities
Source§fn eq(&self, other: &SetupCapabilities) -> bool
fn eq(&self, other: &SetupCapabilities) -> bool
self and other values to be equal, and is used by ==.