pub struct Credentials { /* private fields */ }Expand description
The short-term credentials for a stream: ice-ufrag and ice-pwd (RFC 8839 §5.4).
The two travel together because §5.4 requires both for every data stream, whether they are
written at session or media level, and because RFC 8445 §7.1.2 keys a connectivity check’s
MESSAGE-INTEGRITY on the password that goes with a particular fragment. A type carrying one
without the other would be a credential that cannot authenticate anything.
The fields are private so the length bounds cannot be lost after construction: the send and receive bounds differ, and which one applied is a property of how the value arrived.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub const MAX_SENT_LEN: usize = 32
pub const MAX_SENT_LEN: usize = 32
The longest ice-ufrag or ice-pwd §5.4 permits sipx to send.
Sourcepub const MAX_ACCEPTED_LEN: usize = 256
pub const MAX_ACCEPTED_LEN: usize = 256
The longest either that sipx must accept on receive.
Sourcepub const MIN_UFRAG_LEN: usize = 4
pub const MIN_UFRAG_LEN: usize = 4
The shortest ice-ufrag the grammar admits.
Sourcepub const MIN_PWD_LEN: usize = 22
pub const MIN_PWD_LEN: usize = 22
The shortest ice-pwd the grammar admits.
Sourcepub fn new(ufrag: impl Into<String>, pwd: impl Into<String>) -> Option<Self>
pub fn new(ufrag: impl Into<String>, pwd: impl Into<String>) -> Option<Self>
Credentials sipx will put in an offer or answer.
None when either value is outside what §5.4 permits to be sent: “MUST NOT be longer
than 32 characters when sending, but an implementation MUST accept up to 256 characters
when receiving”. The asymmetry is why this is a different constructor from
Credentials::received rather than a flag — sending 200 characters is a defect, and
receiving them is Tuesday.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
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 Credentials
impl Debug for Credentials
Source§impl PartialEq for Credentials
impl PartialEq for Credentials
Source§fn eq(&self, other: &Credentials) -> bool
fn eq(&self, other: &Credentials) -> bool
self and other values to be equal, and is used by ==.