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

pub struct RadiusAttribute { /* fields omitted */ }

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]

impl PartialEq<RadiusAttribute> for RadiusAttribute[src]

impl StructuralPartialEq for RadiusAttribute[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.

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