Skip to main content

SipHeader

Enum SipHeader 

Source
#[non_exhaustive]
pub enum SipHeader {
Show 134 variants Accept, AcceptContact, AcceptEncoding, AcceptLanguage, AcceptResourcePriority, AdditionalIdentity, AlertInfo, AlertmsgError, Allow, AllowEvents, AnswerMode, AttestationInfo, AuthenticationInfo, Authorization, CallId, CallInfo, CellularNetworkInfo, Contact, ContentDisposition, ContentEncoding, ContentId, ContentLanguage, ContentLength, ContentType, Cseq, Date, DcInfo, Encryption, ErrorInfo, Event, Expires, FeatureCaps, FlowTimer, From, Geolocation, GeolocationError, GeolocationRouting, Hide, HistoryInfo, Identity, IdentityInfo, InfoPackage, InReplyTo, Join, MaxBreadth, MaxForwards, MimeVersion, MinExpires, MinSe, Organization, OriginationId, PAccessNetworkInfo, PAnswerState, PAssertedIdentity, PAssertedService, PAssociatedUri, PCalledPartyId, PChargeInfo, PChargingFunctionAddresses, PChargingVector, PDcsTracePartyId, PDcsOsps, PDcsBillingInfo, PDcsLaes, PDcsRedirect, PEarlyMedia, PMediaAuthorization, PPreferredIdentity, PPreferredService, PPrivateNetworkIndication, PProfileKey, PRefusedUriList, PServedUser, PUserDatabase, PVisitedNetworkId, Path, PermissionMissing, PolicyContact, PolicyId, Priority, PriorityShare, PriorityVerstat, PrivAnswerMode, Privacy, ProxyAuthenticate, ProxyAuthorization, ProxyRequire, Rack, Reason, ReasonPhrase, RecordRoute, RecvInfo, ReferEventsAt, ReferSub, ReferTo, ReferredBy, RejectContact, RelayedCharge, Replaces, ReplyTo, RequestDisposition, Require, ResourcePriority, ResourceShare, ResponseKey, ResponseSource, RestorationInfo, RetryAfter, Route, Rseq, SecurityClient, SecurityServer, SecurityVerify, Server, ServiceInteractInfo, ServiceRoute, SessionExpires, SessionId, SipEtag, SipIfMatch, Subject, SubscriptionState, Supported, SuppressIfMatch, TargetDialog, Timestamp, To, TriggerConsent, Unsupported, UserAgent, UserToUser, Via, Warning, WwwAuthenticate,
}
Expand description

Standard SIP header names with canonical wire casing.

Each variant maps to the header’s canonical form as defined in the relevant RFC. FromStr is case-insensitive; Display always emits the canonical form.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Accept

Accept (RFC 3261).

§

AcceptContact

Accept-Contact.

§

AcceptEncoding

Accept-Encoding (RFC 3261).

§

AcceptLanguage

Accept-Language (RFC 3261).

§

AcceptResourcePriority

Accept-Resource-Priority.

§

AdditionalIdentity

Additional-Identity.

§

AlertInfo

Alert-Info (RFC 3261).

§

AlertmsgError

AlertMsg-Error.

§

Allow

Allow (RFC 3261).

§

AllowEvents

Allow-Events (RFC 6665).

§

AnswerMode

Answer-Mode.

§

AttestationInfo

Attestation-Info.

§

AuthenticationInfo

Authentication-Info.

§

Authorization

Authorization (RFC 3261).

§

CallId

Call-ID (RFC 3261).

§

CallInfo

Call-Info (RFC 3261).

§

CellularNetworkInfo

Cellular-Network-Info.

§

Contact

Contact (RFC 3261).

§

ContentDisposition

Content-Disposition (RFC 3261).

§

ContentEncoding

Content-Encoding (RFC 3261).

§

ContentId

Content-ID.

§

ContentLanguage

Content-Language (RFC 3261).

§

ContentLength

Content-Length (RFC 3261).

§

ContentType

Content-Type (RFC 3261).

§

Cseq

CSeq (RFC 3261).

§

Date

Date (RFC 3261).

§

DcInfo

DC-Info.

§

Encryption

Encryption (deprecated in RFC 3261).

§

ErrorInfo

Error-Info (RFC 3261).

§

Event

Event (RFC 6665).

§

Expires

Expires (RFC 3261).

§

FeatureCaps

Feature-Caps.

§

FlowTimer

Flow-Timer.

§

From

From (RFC 3261).

§

Geolocation

Geolocation (RFC 6442).

§

GeolocationError

Geolocation-Error (RFC 6442).

§

GeolocationRouting

Geolocation-Routing (RFC 6442).

§

Hide

Hide (deprecated in RFC 3261).

§

HistoryInfo

History-Info (RFC 7044).

§

Identity

Identity (RFC 8224).

§

IdentityInfo

Identity-Info.

§

InfoPackage

Info-Package.

§

InReplyTo

In-Reply-To (RFC 3261).

§

Join

Join (RFC 3911).

§

MaxBreadth

Max-Breadth.

§

MaxForwards

Max-Forwards (RFC 3261).

§

MimeVersion

MIME-Version (RFC 3261).

§

MinExpires

Min-Expires (RFC 3261).

§

MinSe

Min-SE (RFC 4028).

§

Organization

Organization (RFC 3261).

§

OriginationId

Origination-Id.

§

PAccessNetworkInfo

P-Access-Network-Info.

§

PAnswerState

P-Answer-State.

§

PAssertedIdentity

P-Asserted-Identity (RFC 3325).

§

PAssertedService

P-Asserted-Service.

§

PAssociatedUri

P-Associated-URI.

§

PCalledPartyId

P-Called-Party-ID.

§

PChargeInfo

P-Charge-Info.

§

PChargingFunctionAddresses

P-Charging-Function-Addresses.

§

PChargingVector

P-Charging-Vector.

§

PDcsTracePartyId

P-DCS-Trace-Party-ID.

§

PDcsOsps

P-DCS-OSPS.

§

PDcsBillingInfo

P-DCS-Billing-Info.

§

PDcsLaes

P-DCS-LAES.

§

PDcsRedirect

P-DCS-Redirect.

§

PEarlyMedia

P-Early-Media.

§

PMediaAuthorization

P-Media-Authorization.

§

PPreferredIdentity

P-Preferred-Identity (RFC 3325).

§

PPreferredService

P-Preferred-Service.

§

PPrivateNetworkIndication

P-Private-Network-Indication.

§

PProfileKey

P-Profile-Key.

§

PRefusedUriList

P-Refused-URI-List.

§

PServedUser

P-Served-User.

§

PUserDatabase

P-User-Database.

§

PVisitedNetworkId

P-Visited-Network-ID.

§

Path

Path (RFC 3327).

§

PermissionMissing

Permission-Missing.

§

PolicyContact

Policy-Contact.

§

PolicyId

Policy-ID.

§

Priority

Priority (RFC 3261).

§

PriorityShare

Priority-Share.

§

PriorityVerstat

Priority-Verstat.

§

PrivAnswerMode

Priv-Answer-Mode.

§

Privacy

Privacy (RFC 3323).

§

ProxyAuthenticate

Proxy-Authenticate (RFC 3261).

§

ProxyAuthorization

Proxy-Authorization (RFC 3261).

§

ProxyRequire

Proxy-Require (RFC 3261).

§

Rack

RAck.

§

Reason

Reason (RFC 3326).

§

ReasonPhrase

Reason-Phrase.

§

RecordRoute

Record-Route (RFC 3261).

§

RecvInfo

Recv-Info.

§

ReferEventsAt

Refer-Events-At.

§

ReferSub

Refer-Sub.

§

ReferTo

Refer-To (RFC 3515).

§

ReferredBy

Referred-By (RFC 3892).

§

RejectContact

Reject-Contact.

§

RelayedCharge

Relayed-Charge.

§

Replaces

Replaces (RFC 3891).

§

ReplyTo

Reply-To (RFC 3261).

§

RequestDisposition

Request-Disposition.

§

Require

Require (RFC 3261).

§

ResourcePriority

Resource-Priority.

§

ResourceShare

Resource-Share.

§

ResponseKey

Response-Key (deprecated in RFC 3261).

§

ResponseSource

Response-Source.

§

RestorationInfo

Restoration-Info.

§

RetryAfter

Retry-After (RFC 3261).

§

Route

Route (RFC 3261).

§

Rseq

RSeq.

§

SecurityClient

Security-Client (RFC 3329).

§

SecurityServer

Security-Server (RFC 3329).

§

SecurityVerify

Security-Verify (RFC 3329).

§

Server

Server (RFC 3261).

§

ServiceInteractInfo

Service-Interact-Info.

§

ServiceRoute

Service-Route (RFC 3608).

§

SessionExpires

Session-Expires (RFC 4028).

§

SessionId

Session-ID.

§

SipEtag

SIP-ETag.

§

SipIfMatch

SIP-If-Match.

§

Subject

Subject (RFC 3261).

§

SubscriptionState

Subscription-State (RFC 6665).

§

Supported

Supported (RFC 3261).

§

SuppressIfMatch

Suppress-If-Match.

§

TargetDialog

Target-Dialog (RFC 4538).

§

Timestamp

Timestamp (RFC 3261).

§

To

To (RFC 3261).

§

TriggerConsent

Trigger-Consent.

§

Unsupported

Unsupported (RFC 3261).

§

UserAgent

User-Agent (RFC 3261).

§

UserToUser

User-to-User (RFC 7433).

§

Via

Via (RFC 3261).

§

Warning

Warning (RFC 3261).

§

WwwAuthenticate

WWW-Authenticate (RFC 3261).

Implementations§

Source§

impl SipHeader

Source

pub fn as_str(&self) -> &'static str

Canonical protocol string.

Source§

impl SipHeader

Source

pub fn from_compact(ch: u8) -> Option<SipHeader>

Resolve a compact form letter to the corresponding header (RFC 3261 §7.3.3).

Case-insensitive: both 'f' and 'F' resolve to SipHeader::From.

Source

pub fn compact_form(&self) -> Option<char>

Return the compact form letter for this header, if one exists.

Source

pub fn is_multi_valued(&self) -> bool

Whether this header may appear multiple times in a SIP message.

Headers listed here use comma-separated or repeated-header semantics per RFC 3261 §7.3.1 and their defining RFCs.

Source

pub fn parse_name(name: &str) -> Result<SipHeader, ParseSipHeaderError>

Parse a header name, including RFC 3261 §7.3.3 compact forms.

Tries compact form resolution for single-character input, then falls back to case-insensitive canonical name matching.

Source§

impl SipHeader

Source

pub fn extract_from(&self, message: &str) -> Option<String>

Extract this header’s value from a raw SIP message.

Recognizes both the canonical header name and its compact form (RFC 3261 §7.3.3). For example, SipHeader::From.extract_from(msg) matches both From: and f: lines.

Trait Implementations§

Source§

impl AsRef<str> for SipHeader

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for SipHeader

Source§

fn clone(&self) -> SipHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SipHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SipHeader

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SipHeader, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for SipHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl FromStr for SipHeader

Source§

type Err = ParseSipHeaderError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<SipHeader, <SipHeader as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for SipHeader

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SipHeader

Source§

fn eq(&self, other: &SipHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SipHeader

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for SipHeader

Source§

impl Eq for SipHeader

Source§

impl StructuralPartialEq for SipHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,