Struct radius_rust::protocol::radius_packet::RadiusAttribute[][src]

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

Represents an attribute, which would be sent to RADIUS Server/client as a part of RadiusPacket

Implementations

impl RadiusAttribute[src]

pub fn create_by_name(
    dictionary: &Dictionary,
    attribute_name: &str,
    value: Vec<u8>
) -> Option<RadiusAttribute>
[src]

Creates RadiusAttribute with given name

Returns None, if ATTRIBUTE with such name is not found in Dictionary

pub fn create_by_id(
    dictionary: &Dictionary,
    attribute_code: u8,
    value: Vec<u8>
) -> Option<RadiusAttribute>
[src]

Creates RadiusAttribute with given id

Returns None, if ATTRIBUTE with such id is not found in Dictionary

pub fn override_value(&mut self, new_value: Vec<u8>)[src]

Overriddes RadiusAttribute value

Mainly used when building Message-Authenticator

pub fn id(&self) -> u8[src]

Returns RadiusAttribute id

pub fn value(&self) -> &[u8][src]

Returns RadiusAttribute value

pub fn name(&self) -> &str[src]

Returns RadiusAttribute name

pub fn verify_original_value(
    &self,
    allowed_type: &Option<SupportedAttributeTypes>
) -> Result<(), RadiusError>
[src]

Verifies RadiusAttribute value, based on the ATTRIBUTE code type

pub fn original_string_value(
    &self,
    allowed_type: &Option<SupportedAttributeTypes>
) -> Result<String, RadiusError>
[src]

Returns RadiusAttribute value, if the attribute is dictionary’s ATTRIBUTE with code type string, ipaddr, ipv6addr or aipv6prefix

pub fn original_integer_value(
    &self,
    allowed_type: &Option<SupportedAttributeTypes>
) -> Result<u64, RadiusError>
[src]

Returns RadiusAttribute value, if the attribute is dictionary’s ATTRIBUTE with code type integer of date

Trait Implementations

impl Debug for RadiusAttribute[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<RadiusAttribute> for RadiusAttribute[src]

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

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

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

This method tests for !=.

impl StructuralPartialEq for RadiusAttribute[src]

Auto Trait Implementations

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, 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