Struct radius_rust::protocol::radius_packet::RadiusAttribute
source · [−]pub struct RadiusAttribute { /* private fields */ }Expand description
Represents an attribute, which would be sent to RADIUS Server/client as a part of RadiusPacket
Implementations
sourceimpl RadiusAttribute
impl RadiusAttribute
sourcepub fn create_by_name(
dictionary: &Dictionary,
attribute_name: &str,
value: Vec<u8>
) -> Option<RadiusAttribute>
pub fn create_by_name(
dictionary: &Dictionary,
attribute_name: &str,
value: Vec<u8>
) -> Option<RadiusAttribute>
Creates RadiusAttribute with given name
Returns None, if ATTRIBUTE with such name is not found in Dictionary
sourcepub fn create_by_id(
dictionary: &Dictionary,
attribute_code: u8,
value: Vec<u8>
) -> Option<RadiusAttribute>
pub fn create_by_id(
dictionary: &Dictionary,
attribute_code: u8,
value: Vec<u8>
) -> Option<RadiusAttribute>
Creates RadiusAttribute with given id
Returns None, if ATTRIBUTE with such id is not found in Dictionary
sourcepub fn override_value(&mut self, new_value: Vec<u8>)
pub fn override_value(&mut self, new_value: Vec<u8>)
Overriddes RadiusAttribute value
Mainly used when building Message-Authenticator
sourcepub fn value(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn value(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns RadiusAttribute value
sourcepub fn verify_original_value(
&self,
allowed_type: &Option<SupportedAttributeTypes>
) -> Result<(), RadiusError>
pub fn verify_original_value(
&self,
allowed_type: &Option<SupportedAttributeTypes>
) -> Result<(), RadiusError>
Verifies RadiusAttribute value, based on the ATTRIBUTE code type
sourcepub fn original_string_value(
&self,
allowed_type: &Option<SupportedAttributeTypes>
) -> Result<String, RadiusError>
pub fn original_string_value(
&self,
allowed_type: &Option<SupportedAttributeTypes>
) -> Result<String, RadiusError>
Returns RadiusAttribute value, if the attribute is dictionary’s ATTRIBUTE with code type string, ipaddr, ipv6addr or ipv6prefix
sourcepub fn original_integer_value(
&self,
allowed_type: &Option<SupportedAttributeTypes>
) -> Result<u32, RadiusError>
pub fn original_integer_value(
&self,
allowed_type: &Option<SupportedAttributeTypes>
) -> Result<u32, RadiusError>
Returns RadiusAttribute value, if the attribute is dictionary’s ATTRIBUTE with code type integer or date
Trait Implementations
sourceimpl Debug for RadiusAttribute
impl Debug for RadiusAttribute
sourceimpl PartialEq<RadiusAttribute> for RadiusAttribute
impl PartialEq<RadiusAttribute> for RadiusAttribute
sourcefn eq(&self, other: &RadiusAttribute) -> bool
fn eq(&self, other: &RadiusAttribute) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &RadiusAttribute) -> bool
fn ne(&self, other: &RadiusAttribute) -> bool
This method tests for !=.
impl StructuralPartialEq for RadiusAttribute
Auto Trait Implementations
impl RefUnwindSafe for RadiusAttribute
impl Send for RadiusAttribute
impl Sync for RadiusAttribute
impl Unpin for RadiusAttribute
impl UnwindSafe for RadiusAttribute
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more