Skip to main content

HeaderName

Enum HeaderName 

Source
#[non_exhaustive]
pub enum HeaderName {
Show 72 variants Accept, AcceptContact, AcceptEncoding, AcceptLanguage, AlertInfo, Allow, AllowEvents, AuthenticationInfo, Authorization, CallId, CallInfo, Contact, ContentDisposition, ContentEncoding, ContentLanguage, ContentLength, ContentType, CSeq, Date, ErrorInfo, Event, Expires, FeatureCaps, From, Identity, IdentityInfo, FlowTimer, InReplyTo, HistoryInfo, MaxForwards, MimeVersion, MinExpires, MinSe, Organization, Path, PAssertedIdentity, PPreferredIdentity, Priority, Privacy, ProxyAuthenticate, ProxyAuthorization, ProxyRequire, RAck, Reason, RecordRoute, ReferSub, ReferTo, ReferredBy, RejectContact, Replaces, ReplyTo, RequestDisposition, Require, RetryAfter, Route, RSeq, Server, ServiceRoute, SessionExpires, SipETag, SipIfMatch, Subject, SubscriptionState, Supported, Timestamp, To, Unsupported, UserAgent, Via, Warning, WwwAuthenticate, Other(Bytes),
}
Expand description

A header field name.

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

§

AcceptContact

Accept-Contact

§

AcceptEncoding

Accept-Encoding

§

AcceptLanguage

Accept-Language

§

AlertInfo

Alert-Info

§

Allow

Allow

§

AllowEvents

Allow-Events

§

AuthenticationInfo

Authentication-Info

§

Authorization

Authorization

§

CallId

Call-ID

§

CallInfo

Call-Info

§

Contact

Contact

§

ContentDisposition

Content-Disposition

§

ContentEncoding

Content-Encoding

§

ContentLanguage

Content-Language

§

ContentLength

Content-Length

§

ContentType

Content-Type

§

CSeq

CSeq

§

Date

Date

§

ErrorInfo

Error-Info

§

Event

Event

§

Expires

Expires

§

FeatureCaps

Feature-Caps

§

From

From

§

Identity

Identity

§

IdentityInfo

Identity-Info

§

FlowTimer

Flow-Timer

§

InReplyTo

In-Reply-To

§

HistoryInfo

History-Info

§

MaxForwards

Max-Forwards

§

MimeVersion

MIME-Version

§

MinExpires

Min-Expires

§

MinSe

Min-SE

§

Organization

Organization

§

Path

Path

§

PAssertedIdentity

P-Asserted-Identity

§

PPreferredIdentity

P-Preferred-Identity

§

Priority

Priority

§

Privacy

Privacy

§

ProxyAuthenticate

Proxy-Authenticate

§

ProxyAuthorization

Proxy-Authorization

§

ProxyRequire

Proxy-Require

§

RAck

RAck

§

Reason

Reason

§

RecordRoute

Record-Route

§

ReferSub

Refer-Sub

§

ReferTo

Refer-To

§

ReferredBy

Referred-By

§

RejectContact

Reject-Contact

§

Replaces

Replaces

§

ReplyTo

Reply-To

§

RequestDisposition

Request-Disposition

§

Require

Require

§

RetryAfter

Retry-After

§

Route

Route

§

RSeq

RSeq

§

Server

Server

§

ServiceRoute

Service-Route

§

SessionExpires

Session-Expires

§

SipETag

SIP-ETag

§

SipIfMatch

SIP-If-Match

§

Subject

Subject

§

SubscriptionState

Subscription-State

§

Supported

Supported

§

Timestamp

Timestamp

§

To

To

§

Unsupported

Unsupported

§

UserAgent

User-Agent

§

Via

Via

§

Warning

Warning

§

WwwAuthenticate

WWW-Authenticate

§

Other(Bytes)

A header sipx does not model. Compared case-insensitively; its bytes are kept.

Implementations§

Source§

impl HeaderName

Source

pub fn canonical(&self) -> &[u8]

The canonical spelling, as sipx writes it in messages it constructs.

Source

pub fn compact(&self) -> Option<u8>

The single-letter compact form, where the header has one.

Source

pub fn parse(raw: &Bytes) -> Self

Resolve a name as it appeared on the wire.

Never fails: an unrecognized name is HeaderName::Other, because a proxy has to forward headers it does not know.

Source§

impl HeaderName

Source

pub fn is_comma_separated_list(&self) -> bool

Whether this header’s grammar is a comma-separated list, so that repeated header lines and one line of comma-separated values mean the same thing (RFC 3261 §7.3.1).

The authentication headers are the exception the RFC calls out by name: their values contain commas of their own, so splitting on commas would corrupt them.

Source

pub fn is_single_value(&self) -> bool

Whether the RFC permits at most one of this header in a message.

RFC 4475 §3.3.8 turns on this: a message with two To headers parses, and must be rejected by validation rather than by silently using the first.

Trait Implementations§

Source§

impl Clone for HeaderName

Source§

fn clone(&self) -> HeaderName

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for HeaderName

Source§

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

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

impl Display for HeaderName

Source§

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

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

impl Hash for HeaderName

Source§

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

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 HeaderName

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Eq for HeaderName

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<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> Same for T

Source§

type Output = T

Should always be Self
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.