Skip to main content

ServerDispatcher

Trait ServerDispatcher 

Source
pub trait ServerDispatcher {
    // Required methods
    fn try_validate_parameters(&self) -> Result<&ServerParameters, Status>;
    fn dispatch_get_option(&self, code: OptionCode) -> Result<Option_, Status>;
    fn dispatch_get_parameter(
        &self,
        name: ParameterName,
    ) -> Result<Parameter, Status>;
    fn dispatch_set_option(&mut self, value: Option_) -> Result<(), Status>;
    fn dispatch_set_parameter(&mut self, value: Parameter) -> Result<(), Status>;
    fn dispatch_list_options(&self) -> Result<Vec<Option_>, Status>;
    fn dispatch_list_parameters(&self) -> Result<Vec<Parameter>, Status>;
    fn dispatch_reset_options(&mut self) -> Result<(), Status>;
    fn dispatch_reset_parameters(
        &mut self,
        defaults: &ServerParameters,
    ) -> Result<(), Status>;
    fn dispatch_clear_leases(&mut self) -> Result<(), Status>;
}
Expand description

The ability to dispatch fuchsia.net.dhcp.Server protocol requests and return a value.

Implementers of this trait can be used as the backing server-side logic of the fuchsia.net.dhcp.Server protocol. Implementers must maintain a store of DHCP Options, DHCP server parameters, and leases issued to clients, and support the trait methods to retrieve and modify these stores.

Required Methods§

Source

fn try_validate_parameters(&self) -> Result<&ServerParameters, Status>

Validates the current set of server parameters returning a reference to the parameters if the configuration is valid or an error otherwise.

Source

fn dispatch_get_option(&self, code: OptionCode) -> Result<Option_, Status>

Retrieves the stored DHCP option value that corresponds to the OptionCode argument.

Source

fn dispatch_get_parameter( &self, name: ParameterName, ) -> Result<Parameter, Status>

Retrieves the stored DHCP server parameter value that corresponds to the ParameterName argument.

Source

fn dispatch_set_option(&mut self, value: Option_) -> Result<(), Status>

Updates the stored DHCP option value to the argument.

Source

fn dispatch_set_parameter(&mut self, value: Parameter) -> Result<(), Status>

Updates the stored DHCP server parameter to the argument.

Source

fn dispatch_list_options(&self) -> Result<Vec<Option_>, Status>

Retrieves all of the stored DHCP option values.

Source

fn dispatch_list_parameters(&self) -> Result<Vec<Parameter>, Status>

Retrieves all of the stored DHCP parameter values.

Source

fn dispatch_reset_options(&mut self) -> Result<(), Status>

Resets all DHCP options to have no value.

Source

fn dispatch_reset_parameters( &mut self, defaults: &ServerParameters, ) -> Result<(), Status>

Resets all DHCP server parameters to their default values in defaults.

Source

fn dispatch_clear_leases(&mut self) -> Result<(), Status>

Clears all leases from the store maintained by the ServerDispatcher.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<DS: DataStore, TS: SystemTimeSource> ServerDispatcher for Server<DS, TS>

Available on Fuchsia only.