Struct radius::core::avp::AVP[][src]

pub struct AVP { /* fields omitted */ }
Expand description

This struct represents a attribute-value pair.

Implementations

impl AVP[src]

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

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

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

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

pub fn from_tagged_u32(typ: AVPType, tag: Option<&Tag>, value: u32) -> Self[src]

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

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

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

pub fn from_tagged_string(typ: AVPType, tag: Option<&Tag>, value: &str) -> Self[src]

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

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

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

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

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

pub fn from_ipv4_prefix(typ: AVPType, prefix: &[u8]) -> Result<Self, AVPError>[src]

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

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

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

pub fn from_ipv6_prefix(typ: AVPType, prefix: &[u8]) -> Result<Self, AVPError>[src]

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

pub fn from_user_password(
    typ: AVPType,
    plain_text: &[u8],
    secret: &[u8],
    request_authenticator: &[u8]
) -> Result<Self, AVPError>
[src]

(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

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

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

pub fn from_tunnel_password(
    typ: AVPType,
    tag: Option<&Tag>,
    plain_text: &[u8],
    secret: &[u8],
    request_authenticator: &[u8]
) -> Result<Self, AVPError>
[src]

(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

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

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

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

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

pub fn encode_tagged_u32(&self) -> Result<(u32, Tag), AVPError>[src]

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

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

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

pub fn encode_tagged_string(&self) -> Result<(String, Option<Tag>), AVPError>[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Trait Implementations

impl Clone for AVP[src]

fn clone(&self) -> AVP[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for AVP[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<AVP> for AVP[src]

fn eq(&self, other: &AVP) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &AVP) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for AVP[src]

Auto Trait Implementations

impl RefUnwindSafe for AVP

impl Send for AVP

impl Sync for AVP

impl Unpin for AVP

impl UnwindSafe for AVP

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V