pub struct SipFragment {
pub message_type: Option<SipMessageType>,
pub headers: Headers,
pub body: Vec<u8>,
}Expand description
A message/sipfrag body (RFC 3420): any prefix of a SIP message.
Unlike ParsedSipMessage, every element is optional — a fragment may
carry a start line, headers, a body, or any combination, and needs no
trailing CRLF. It has no transport metadata of its own; that belongs to
the message carrying it.
Fields§
§message_type: Option<SipMessageType>Request or status line, when the fragment begins with one.
headers: HeadersFragment headers in wire order.
body: Vec<u8>Body bytes after the \r\n\r\n terminator, empty when absent.
Implementations§
Source§impl SipFragment
impl SipFragment
Sourcepub fn media_type(&self) -> Option<Cow<'_, str>>
pub fn media_type(&self) -> Option<Cow<'_, str>>
Content-Type with parameters stripped and lowercased, e.g.
application/sdp from Application/SDP; charset=utf-8. Use this to
dispatch on the type rather than matching the raw header value.
Source§impl SipFragment
impl SipFragment
Sourcepub fn header_value(&self, name: &str) -> Option<&str>
pub fn header_value(&self, name: &str) -> Option<&str>
Case-insensitive header lookup, first match in wire order.
Sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Returns the Content-Type header value. Checks both Content-Type and
the compact form c.
Trait Implementations§
Source§impl Clone for SipFragment
impl Clone for SipFragment
Source§fn clone(&self) -> SipFragment
fn clone(&self) -> SipFragment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more