AVP

Struct AVP 

Source
pub struct AVP { /* private fields */ }
Expand description

This struct represents a attribute-value pair.

Implementations§

Source§

impl AVP

Source

pub fn from_u32(typ: AVPType, value: u32) -> Self

(This method is for dictionary developers) make an AVP from a u32 value.

Source

pub fn from_u16(typ: AVPType, value: u16) -> Self

(This method is for dictionary developers) make an AVP from a u16 value.

Source

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.

Source

pub fn from_string(typ: AVPType, value: &str) -> Self

(This method is for dictionary developers) make an AVP from a string value.

Source

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.

Source

pub fn from_bytes(typ: AVPType, value: &[u8]) -> Self

(This method is for dictionary developers) make an AVP from bytes.

Source

pub fn from_ipv4(typ: AVPType, value: &Ipv4Addr) -> Self

(This method is for dictionary developers) make an AVP from a IPv4 value.

Source

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.

Source

pub fn from_ipv6(typ: AVPType, value: &Ipv6Addr) -> Self

(This method is for dictionary developers) make an AVP from a IPv6 value.

Source

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.

Source

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

Source

pub fn from_date(typ: AVPType, dt: &DateTime<Utc>) -> Self

(This method is for dictionary developers) make an AVP from a date value.

Source

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

Source

pub fn encode_u32(&self) -> Result<u32, AVPError>

(This method is for dictionary developers) encode an AVP into a u32 value.

Source

pub fn encode_u16(&self) -> Result<u16, AVPError>

(This method is for dictionary developers) encode an AVP into a u16 value.

Source

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.

Source

pub fn encode_string(&self) -> Result<String, AVPError>

(This method is for dictionary developers) encode an AVP into a string value.

Source

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.

Source

pub fn encode_bytes(&self) -> Vec<u8>

(This method is for dictionary developers) encode an AVP into bytes.

Source

pub fn encode_ipv4(&self) -> Result<Ipv4Addr, AVPError>

(This method is for dictionary developers) encode an AVP into Ipv4 value.

Source

pub fn encode_ipv4_prefix(&self) -> Result<Vec<u8>, AVPError>

(This method is for dictionary developers) encode an AVP into Ipv4-prefix value.

Source

pub fn encode_ipv6(&self) -> Result<Ipv6Addr, AVPError>

(This method is for dictionary developers) encode an AVP into Ipv6 value.

Source

pub fn encode_ipv6_prefix(&self) -> Result<Vec<u8>, AVPError>

(This method is for dictionary developers) encode an AVP into Ipv6-prefix value.

Source

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.

Source

pub fn encode_date(&self) -> Result<DateTime<Utc>, AVPError>

(This method is for dictionary developers) encode an AVP into date value.

Source

pub fn encode_tunnel_password( &self, secret: &[u8], request_authenticator: &[u8], ) -> Result<(Vec<u8>, Tag), AVPError>

(This method is for dictionary developers) encode an AVP into a tunnel-password value as bytes.

Trait Implementations§

Source§

impl Clone for AVP

Source§

fn clone(&self) -> AVP

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 AVP

Source§

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

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

impl PartialEq for AVP

Source§

fn eq(&self, other: &AVP) -> 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 StructuralPartialEq for AVP

Auto Trait Implementations§

§

impl Freeze for AVP

§

impl RefUnwindSafe for AVP

§

impl Send for AVP

§

impl Sync for AVP

§

impl Unpin for AVP

§

impl UnwindSafe for AVP

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> 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V