pub enum TypedHeader {
Show 62 variants
Via(Via),
From(From),
To(To),
Contact(Contact),
CallId(CallId),
CSeq(CSeq),
Route(Route),
RecordRoute(RecordRoute),
MaxForwards(MaxForwards),
ContentType(ContentType),
ContentLength(ContentLength),
Expires(Expires),
Authorization(Authorization),
WwwAuthenticate(WwwAuthenticate),
ProxyAuthenticate(ProxyAuthenticate),
ProxyAuthorization(ProxyAuthorization),
AuthenticationInfo(AuthenticationInfo),
Accept(Accept),
Allow(Allow),
ReplyTo(ReplyTo),
ReferTo(ReferTo),
ReferredBy(ReferredBy),
Require(Require),
Warning(Vec<Warning>),
ContentDisposition(ContentDisposition),
Subject(Subject),
Event(Event),
SubscriptionState(SubscriptionState),
ContentEncoding(ContentEncoding),
ContentLanguage(ContentLanguage),
AcceptEncoding(AcceptEncoding),
AcceptLanguage(AcceptLanguage),
MinExpires(MinExpires),
MimeVersion(MimeVersion),
Supported(Supported),
Unsupported(Unsupported),
ProxyRequire(ProxyRequire),
Date(DateTime<FixedOffset>),
Timestamp((NotNan<f32>, Option<NotNan<f32>>)),
Organization(Organization),
Priority(Priority),
Server(Vec<String>),
UserAgent(Vec<String>),
InReplyTo(InReplyTo),
RetryAfter(RetryAfter),
ErrorInfo(ErrorInfoHeader),
AlertInfo(AlertInfoHeader),
CallInfo(CallInfo),
Path(Path),
ServiceRoute(ServiceRoute),
Reason(Reason),
SessionExpires(SessionExpires),
MinSE(MinSE),
RSeq(RSeq),
RAck(RAck),
SipETag(SipETag),
SipIfMatch(SipIfMatch),
AllowEvents(AllowEvents),
PAssertedIdentity(PAssertedIdentity),
PPreferredIdentity(PPreferredIdentity),
Identity(Identity),
Other(HeaderName, HeaderValue),
}Expand description
A strongly-typed representation of a SIP header.
This enum provides a type-safe way to work with parsed SIP headers. Each variant corresponds to a specific header type with its appropriately typed value.
Unlike the more generic Header, which stores headers as name-value pairs,
TypedHeader stores the header’s value in a strongly-typed form, making it safer
and more convenient to work with known header types.
§Examples
use rvoip_sip_core::prelude::*;
use std::convert::TryFrom;
// Create a typed Call-ID header
let call_id = CallId::new("f81d4fae-7dec-11d0-a765-00a0c91e6bf6@example.com");
let header = TypedHeader::CallId(call_id);
// Access the header name
assert_eq!(header.name(), HeaderName::CallId);
// Convert to string representation
let header_str = header.to_string();
assert!(header_str.contains("Call-ID"));
assert!(header_str.contains("f81d4fae-7dec-11d0-a765-00a0c91e6bf6@example.com"));Variants§
Via(Via)
From(From)
To(To)
Contact(Contact)
CallId(CallId)
CSeq(CSeq)
Route(Route)
RecordRoute(RecordRoute)
MaxForwards(MaxForwards)
ContentType(ContentType)
ContentLength(ContentLength)
Expires(Expires)
Authorization(Authorization)
WwwAuthenticate(WwwAuthenticate)
ProxyAuthenticate(ProxyAuthenticate)
ProxyAuthorization(ProxyAuthorization)
AuthenticationInfo(AuthenticationInfo)
Accept(Accept)
Allow(Allow)
ReplyTo(ReplyTo)
ReferTo(ReferTo)
ReferredBy(ReferredBy)
Require(Require)
Warning(Vec<Warning>)
ContentDisposition(ContentDisposition)
Subject(Subject)
Event(Event)
SubscriptionState(SubscriptionState)
ContentEncoding(ContentEncoding)
ContentLanguage(ContentLanguage)
AcceptEncoding(AcceptEncoding)
AcceptLanguage(AcceptLanguage)
MinExpires(MinExpires)
MimeVersion(MimeVersion)
Supported(Supported)
Unsupported(Unsupported)
ProxyRequire(ProxyRequire)
Date(DateTime<FixedOffset>)
Timestamp((NotNan<f32>, Option<NotNan<f32>>))
Organization(Organization)
Priority(Priority)
Server(Vec<String>)
UserAgent(Vec<String>)
InReplyTo(InReplyTo)
RetryAfter(RetryAfter)
ErrorInfo(ErrorInfoHeader)
AlertInfo(AlertInfoHeader)
CallInfo(CallInfo)
Path(Path)
ServiceRoute(ServiceRoute)
Reason(Reason)
SessionExpires(SessionExpires)
MinSE(MinSE)
RSeq(RSeq)
RAck(RAck)
RAck header (RFC 3262 §7.2) — acknowledges a reliable provisional response in a PRACK request. Carries rseq, cseq, and method.
SipETag(SipETag)
SipIfMatch(SipIfMatch)
AllowEvents(AllowEvents)
PAssertedIdentity(PAssertedIdentity)
P-Asserted-Identity (RFC 3325)
PPreferredIdentity(PPreferredIdentity)
P-Preferred-Identity (RFC 3325)
Identity(Identity)
Identity (RFC 8224) — STIR signed PASSporT token
Other(HeaderName, HeaderValue)
Represents an unknown or unparsed header.
Implementations§
Source§impl TypedHeader
impl TypedHeader
Sourcepub fn name(&self) -> HeaderName
pub fn name(&self) -> HeaderName
Returns the name of the header
Sourcepub fn as_typed_ref<'a, T>(&'a self) -> Option<&'a T>
pub fn as_typed_ref<'a, T>(&'a self) -> Option<&'a T>
Try to convert this TypedHeader to a reference of a specific header type
This method is used internally by the HeaderAccess trait implementations to provide type-safe access to headers.
Trait Implementations§
Source§impl Clone for TypedHeader
impl Clone for TypedHeader
Source§fn clone(&self) -> TypedHeader
fn clone(&self) -> TypedHeader
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 TypedHeader
impl Debug for TypedHeader
Source§impl<'de> Deserialize<'de> for TypedHeader
impl<'de> Deserialize<'de> for TypedHeader
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypedHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypedHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for TypedHeader
impl Display for TypedHeader
Source§impl From<&TypedHeader> for HeaderName
impl From<&TypedHeader> for HeaderName
Source§fn from(header: &TypedHeader) -> HeaderName
fn from(header: &TypedHeader) -> HeaderName
Source§impl PartialEq for TypedHeader
impl PartialEq for TypedHeader
Source§fn eq(&self, other: &TypedHeader) -> bool
fn eq(&self, other: &TypedHeader) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for TypedHeader
impl Serialize for TypedHeader
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for TypedHeader
Source§impl TryFrom<&Header> for TypedHeader
impl TryFrom<&Header> for TypedHeader
Auto Trait Implementations§
impl Freeze for TypedHeader
impl RefUnwindSafe for TypedHeader
impl Send for TypedHeader
impl Sync for TypedHeader
impl Unpin for TypedHeader
impl UnsafeUnpin for TypedHeader
impl UnwindSafe for TypedHeader
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SipJson for Twhere
T: Serialize + DeserializeOwned,
impl<T> SipJson for Twhere
T: Serialize + DeserializeOwned,
Source§fn to_sip_value(&self) -> Result<SipValue, SipJsonError>
fn to_sip_value(&self) -> Result<SipValue, SipJsonError>
Source§fn from_sip_value(value: &SipValue) -> Result<T, SipJsonError>
fn from_sip_value(value: &SipValue) -> Result<T, SipJsonError>
Source§impl<T> SipJsonExt for T
impl<T> SipJsonExt for T
Source§fn path(&self, path: impl AsRef<str>) -> Option<SipValue>
fn path(&self, path: impl AsRef<str>) -> Option<SipValue>
Simple path accessor that returns an Option directly
Source§fn path_str(&self, path: impl AsRef<str>) -> Option<String>
fn path_str(&self, path: impl AsRef<str>) -> Option<String>
Get a string value at the given path
Source§fn path_str_or(&self, path: impl AsRef<str>, default: &str) -> String
fn path_str_or(&self, path: impl AsRef<str>, default: &str) -> String
Get a string value at the given path, or return the default value if not found