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

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

Represents RADIUS packet

Implementations

impl RadiusPacket[src]

pub fn initialise_packet(code: TypeCode) -> RadiusPacket[src]

Initialises RADIUS packet with random ID and authenticator

pub fn initialise_packet_from_bytes(
    dictionary: &Dictionary,
    bytes: &[u8]
) -> Result<RadiusPacket, RadiusError>
[src]

Initialises RADIUS packet from raw bytes

pub fn set_attributes(&mut self, attributes: Vec<RadiusAttribute>)[src]

Sets attrbiutes

pub fn override_id(&mut self, new_id: u8)[src]

Overrides RadiusPacket id

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

Overrides RadiusPacket authenticator

pub fn override_message_authenticator(
    &mut self,
    new_message_authenticator: Vec<u8>
) -> Result<(), RadiusError>
[src]

Overrides RadiusPacket Message-Authenticator

Note: would fail if RadiusPacket has no Message-Authenticator attribute defined

pub fn message_authenticator(&self) -> Result<&[u8], RadiusError>[src]

Returns Message-Authenticator value, if exists in RadiusPacket

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

Returns RadiusPacket id

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

Returns RadiusPacket authenticator

pub fn code(&self) -> &TypeCode[src]

Returns RadiusPacket code

pub fn attributes(&self) -> &[RadiusAttribute][src]

Returns RadiusPacket attributes

pub fn attribute_by_name(&self, name: &str) -> Option<&RadiusAttribute>[src]

Returns RadiusAttribute with given name

pub fn attribute_by_id(&self, id: u8) -> Option<&RadiusAttribute>[src]

Returns RadiusAttribute with given id

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

Converts RadiusPacket into ready-to-be-sent bytes vector

Trait Implementations

impl Debug for RadiusPacket[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<RadiusPacket> for RadiusPacket[src]

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

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

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

This method tests for !=.

impl StructuralPartialEq for RadiusPacket[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