pub struct PAssertedIdentityList { /* private fields */ }Expand description
A complete identity field: strict for construction, tolerant and explicit on receive.
Implementations§
Source§impl PAssertedIdentityList
impl PAssertedIdentityList
Sourcepub fn new(
values: impl IntoIterator<Item = PAssertedIdentity>,
) -> Result<Self, HeaderError>
pub fn new( values: impl IntoIterator<Item = PAssertedIdentity>, ) -> Result<Self, HeaderError>
Construct a complete RFC 3325 field, enforcing its one-or-two-value invariant.
Sourcepub fn from_headers(headers: &Headers) -> Result<Option<Self>, HeaderError>
pub fn from_headers(headers: &Headers) -> Result<Option<Self>, HeaderError>
Decode all received rows in wire order using RFC 5876 §4.5 filtering.
Ok(None) means the field is absent. Unexpected schemes, duplicate schemes and
a SIP/SIPS combination are not syntax errors: they appear in Self::ignored. A
forwarding proxy must remove those indexed values before sending the request;
applying several removals in descending index order keeps earlier indices stable.
Sourcepub fn values(&self) -> &[PAssertedIdentity]
pub fn values(&self) -> &[PAssertedIdentity]
Values that may be used and forwarded, in their received or construction order.
Sourcepub fn ignored(&self) -> &[IgnoredIdentity]
pub fn ignored(&self) -> &[IgnoredIdentity]
Values RFC 5876 says to ignore and not forward, with stable wire-order indices.
Remove several values from Headers in reverse order so each remaining index
still refers to the field shape this report describes.
Sourcepub fn requires_rewrite(&self) -> bool
pub fn requires_rewrite(&self) -> bool
Whether forwarding the original field unchanged would violate RFC 5876 §4.5.
Sourcepub fn into_parts(self) -> (Vec<PAssertedIdentity>, Vec<IgnoredIdentity>)
pub fn into_parts(self) -> (Vec<PAssertedIdentity>, Vec<IgnoredIdentity>)
Consume the list and return the usable values plus the ignored-value report.
Sourcepub fn to_bytes(&self) -> Option<Bytes>
pub fn to_bytes(&self) -> Option<Bytes>
Serialize the usable values as one deterministic comma-and-space-delimited row.
Ignored received values are deliberately absent: RFC 5876 forbids forwarding them.
None means every received value was ignored, so a proxy removes the field rather
than constructing an invalid empty row.
Trait Implementations§
Source§impl Clone for PAssertedIdentityList
impl Clone for PAssertedIdentityList
Source§fn clone(&self) -> PAssertedIdentityList
fn clone(&self) -> PAssertedIdentityList
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more