State

Trait State 

Source
pub trait State {
    // Required methods
    fn req_connection(self: Box<Self>) -> Box<dyn State>;
    fn req_bind(self: Box<Self>) -> Box<dyn State>;
    fn req_search(self: Box<Self>) -> Box<dyn State>;
    fn clone_dyn(&self) -> Box<dyn State>;

    // Provided method
    fn get_entries(
        self: Box<Self>,
        _request: &Request,
    ) -> Option<Vec<ResultEntry>> { ... }
}
Expand description

State design pattern to Request

Required Methods§

Source

fn req_connection(self: Box<Self>) -> Box<dyn State>

Source

fn req_bind(self: Box<Self>) -> Box<dyn State>

Source

fn clone_dyn(&self) -> Box<dyn State>

Provided Methods§

Source

fn get_entries(self: Box<Self>, _request: &Request) -> Option<Vec<ResultEntry>>

Trait Implementations§

Source§

impl Clone for Box<dyn State>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§