pub struct AVP { /* private fields */ }Expand description
This struct represents a attribute-value pair.
Implementations§
Source§impl AVP
impl AVP
Sourcepub fn from_u32(typ: AVPType, value: u32) -> Self
pub fn from_u32(typ: AVPType, value: u32) -> Self
(This method is for dictionary developers) make an AVP from a u32 value.
Sourcepub fn from_u16(typ: AVPType, value: u16) -> Self
pub fn from_u16(typ: AVPType, value: u16) -> Self
(This method is for dictionary developers) make an AVP from a u16 value.
Sourcepub fn from_tagged_u32(typ: AVPType, tag: Option<&Tag>, value: u32) -> Self
pub fn from_tagged_u32(typ: AVPType, tag: Option<&Tag>, value: u32) -> Self
(This method is for dictionary developers) make an AVP from a tagged u32 value.
Sourcepub fn from_string(typ: AVPType, value: &str) -> Self
pub fn from_string(typ: AVPType, value: &str) -> Self
(This method is for dictionary developers) make an AVP from a string value.
Sourcepub fn from_tagged_string(typ: AVPType, tag: Option<&Tag>, value: &str) -> Self
pub fn from_tagged_string(typ: AVPType, tag: Option<&Tag>, value: &str) -> Self
(This method is for dictionary developers) make an AVP from a tagged string value.
Sourcepub fn from_bytes(typ: AVPType, value: &[u8]) -> Self
pub fn from_bytes(typ: AVPType, value: &[u8]) -> Self
(This method is for dictionary developers) make an AVP from bytes.
Sourcepub fn from_ipv4(typ: AVPType, value: &Ipv4Addr) -> Self
pub fn from_ipv4(typ: AVPType, value: &Ipv4Addr) -> Self
(This method is for dictionary developers) make an AVP from a IPv4 value.
Sourcepub fn from_ipv4_prefix(typ: AVPType, prefix: &[u8]) -> Result<Self, AVPError>
pub fn from_ipv4_prefix(typ: AVPType, prefix: &[u8]) -> Result<Self, AVPError>
(This method is for dictionary developers) make an AVP from a IPv4-prefix value.
Sourcepub fn from_ipv6(typ: AVPType, value: &Ipv6Addr) -> Self
pub fn from_ipv6(typ: AVPType, value: &Ipv6Addr) -> Self
(This method is for dictionary developers) make an AVP from a IPv6 value.
Sourcepub fn from_ipv6_prefix(typ: AVPType, prefix: &[u8]) -> Result<Self, AVPError>
pub fn from_ipv6_prefix(typ: AVPType, prefix: &[u8]) -> Result<Self, AVPError>
(This method is for dictionary developers) make an AVP from a IPv6-prefix value.
Sourcepub fn from_user_password(
typ: AVPType,
plain_text: &[u8],
secret: &[u8],
request_authenticator: &[u8],
) -> Result<Self, AVPError>
pub fn from_user_password( typ: AVPType, plain_text: &[u8], secret: &[u8], request_authenticator: &[u8], ) -> Result<Self, AVPError>
(This method is for dictionary developers) make an AVP from a user-password value. see also: https://tools.ietf.org/html/rfc2865#section-5.2
Sourcepub fn from_date(typ: AVPType, dt: &DateTime<Utc>) -> Self
pub fn from_date(typ: AVPType, dt: &DateTime<Utc>) -> Self
(This method is for dictionary developers) make an AVP from a date value.
Sourcepub fn from_tunnel_password(
typ: AVPType,
tag: Option<&Tag>,
plain_text: &[u8],
secret: &[u8],
request_authenticator: &[u8],
) -> Result<Self, AVPError>
pub fn from_tunnel_password( typ: AVPType, tag: Option<&Tag>, plain_text: &[u8], secret: &[u8], request_authenticator: &[u8], ) -> Result<Self, AVPError>
(This method is for dictionary developers) make an AVP from a tunne-password value. see also: https://tools.ietf.org/html/rfc2868#section-3.5
Sourcepub fn encode_u32(&self) -> Result<u32, AVPError>
pub fn encode_u32(&self) -> Result<u32, AVPError>
(This method is for dictionary developers) encode an AVP into a u32 value.
Sourcepub fn encode_u16(&self) -> Result<u16, AVPError>
pub fn encode_u16(&self) -> Result<u16, AVPError>
(This method is for dictionary developers) encode an AVP into a u16 value.
Sourcepub fn encode_tagged_u32(&self) -> Result<(u32, Tag), AVPError>
pub fn encode_tagged_u32(&self) -> Result<(u32, Tag), AVPError>
(This method is for dictionary developers) encode an AVP into a tag and u32 value.
Sourcepub fn encode_string(&self) -> Result<String, AVPError>
pub fn encode_string(&self) -> Result<String, AVPError>
(This method is for dictionary developers) encode an AVP into a string value.
Sourcepub fn encode_tagged_string(&self) -> Result<(String, Option<Tag>), AVPError>
pub fn encode_tagged_string(&self) -> Result<(String, Option<Tag>), AVPError>
(This method is for dictionary developers) encode an AVP into a tag and string value.
Sourcepub fn encode_bytes(&self) -> Vec<u8> ⓘ
pub fn encode_bytes(&self) -> Vec<u8> ⓘ
(This method is for dictionary developers) encode an AVP into bytes.
Sourcepub fn encode_ipv4(&self) -> Result<Ipv4Addr, AVPError>
pub fn encode_ipv4(&self) -> Result<Ipv4Addr, AVPError>
(This method is for dictionary developers) encode an AVP into Ipv4 value.
Sourcepub fn encode_ipv4_prefix(&self) -> Result<Vec<u8>, AVPError>
pub fn encode_ipv4_prefix(&self) -> Result<Vec<u8>, AVPError>
(This method is for dictionary developers) encode an AVP into Ipv4-prefix value.
Sourcepub fn encode_ipv6(&self) -> Result<Ipv6Addr, AVPError>
pub fn encode_ipv6(&self) -> Result<Ipv6Addr, AVPError>
(This method is for dictionary developers) encode an AVP into Ipv6 value.
Sourcepub fn encode_ipv6_prefix(&self) -> Result<Vec<u8>, AVPError>
pub fn encode_ipv6_prefix(&self) -> Result<Vec<u8>, AVPError>
(This method is for dictionary developers) encode an AVP into Ipv6-prefix value.
Sourcepub fn encode_user_password(
&self,
secret: &[u8],
request_authenticator: &[u8],
) -> Result<Vec<u8>, AVPError>
pub fn encode_user_password( &self, secret: &[u8], request_authenticator: &[u8], ) -> Result<Vec<u8>, AVPError>
(This method is for dictionary developers) encode an AVP into user-password value as bytes.