Struct radius_rust::protocol::radius_packet::RadiusPacket [−][src]
pub struct RadiusPacket { /* fields omitted */ }
Represents RADIUS packet
Implementations
impl RadiusPacket
[src]
pub fn initialise_packet(
code: TypeCode,
attributes: Vec<RadiusAttribute>
) -> RadiusPacket
[src]
code: TypeCode,
attributes: Vec<RadiusAttribute>
) -> RadiusPacket
Initialises RADIUS packet with random ID and authenticator
pub fn initialise_packet_from_bytes(
dictionary: &Dictionary,
bytes: &[u8]
) -> Result<RadiusPacket, RadiusError>
[src]
dictionary: &Dictionary,
bytes: &[u8]
) -> Result<RadiusPacket, RadiusError>
Initialises RADIUS packet from raw bytes
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]
&mut self,
new_message_authenticator: Vec<u8>
) -> Result<(), RadiusError>
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]
impl PartialEq<RadiusPacket> for RadiusPacket
[src]
fn eq(&self, other: &RadiusPacket) -> bool
[src]
fn ne(&self, other: &RadiusPacket) -> bool
[src]
impl StructuralPartialEq for RadiusPacket
[src]
Auto Trait Implementations
impl RefUnwindSafe for RadiusPacket
impl Send for RadiusPacket
impl Sync for RadiusPacket
impl Unpin for RadiusPacket
impl UnwindSafe for RadiusPacket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,