Struct radius::server::Server[][src]

pub struct Server<X, E: Debug, T: RequestHandler<X, E>, U: SecretProvider> { /* fields omitted */ }

A basic implementation of the RADIUS server.

Example Usage

  • https://github.com/moznion/radius-rs/blob/HEAD/examples/server.rs

Implementations

impl<X, E: Debug, T: RequestHandler<X, E>, U: SecretProvider> Server<X, E, T, U>[src]

pub async fn listen(
    host: &str,
    port: u16,
    request_handler: T,
    secret_provider: U
) -> Result<Self, Error>
[src]

Starts UDP listening for the RADIUS server. After this function call is finished, the RADIUS server becomes ready to handle the requests; then it calls run() method for a Server instance that returned by this function, it starts RADIUS request handling.

Parameters

  • host - a host to listen (e.g. 0.0.0.0)
  • port - a port number to listen (e.g. 1812)
  • request_handler - a request handler for the RADIUS requests.
  • secret_provider - a provider for shared-secret value.

pub async fn run(&mut self, shutdown_trigger: impl Future) -> Result<(), Error>[src]

Starts the RADIUS requests handling.

Parameters

  • shutdown_trigger: an implementation of the Future to interrupt to shutdown the RADIUS server (e.g. signal::ctrl_c())

pub fn set_buffer_size(&mut self, buf_size: usize)[src]

Set a buffer size for receiving the request payload (default: 1500).

pub fn set_skip_authenticity_validation(
    &mut self,
    skip_authenticity_validation: bool
)
[src]

Set a flag to specify whether to skip the authenticity validation or not (default: false).

pub fn get_listen_address(&self) -> Result<SocketAddr>[src]

Returns the listening address.

Auto Trait Implementations

impl<X, E, T, U> !RefUnwindSafe for Server<X, E, T, U>[src]

impl<X, E, T, U> Send for Server<X, E, T, U> where
    E: Send,
    X: Send
[src]

impl<X, E, T, U> Sync for Server<X, E, T, U> where
    E: Sync,
    X: Sync
[src]

impl<X, E, T, U> Unpin for Server<X, E, T, U> where
    E: Unpin,
    X: Unpin
[src]

impl<X, E, T, U> !UnwindSafe for Server<X, E, T, U>[src]

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