Struct radius::server::Server [−][src]
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]
host: &str,
port: u16,
request_handler: T,
secret_provider: U
) -> Result<Self, Error>
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 theFuture
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]
&mut self,
skip_authenticity_validation: bool
)
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]
E: Send,
X: Send,
impl<X, E, T, U> Sync for Server<X, E, T, U> where
E: Sync,
X: Sync,
[src]
E: Sync,
X: Sync,
impl<X, E, T, U> Unpin for Server<X, E, T, U> where
E: Unpin,
X: Unpin,
[src]
E: Unpin,
X: Unpin,
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]
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>,