Struct lexa_framework::server::Server
source · pub struct Server<UserState> {
pub state: State<UserState>,
pub application_settings: Settings,
/* private fields */
}
Fields§
§state: State<UserState>
§application_settings: Settings
Implementations§
source§impl<UserState> Server<UserState>where
UserState: 'static + StateInterface,
impl<UserState> Server<UserState>where UserState: 'static + StateInterface,
pub fn layer<Layer>(self, layer: Layer) -> Selfwhere Layer: Clone + Send + Sync + 'static + Layer<Route>, Layer::Service: Service<Request<Body>, Error = Infallible> + Clone + Send + 'static, <Layer::Service as Service<Request<Body>>>::Response: IntoResponse + 'static, <Layer::Service as Service<Request<Body>>>::Future: Send + 'static,
sourcepub fn make_application<A>(self) -> Selfwhere
A: Application<State = UserState>,
pub fn make_application<A>(self) -> Selfwhere A: Application<State = UserState>,
Crée une application qui est scopée pour le serveur.
sourcepub async fn run(self) -> Result<(), Error>
pub async fn run(self) -> Result<(), Error>
Démarre un serveur WEB avec ses composants. En se basant sur les configurations de l’utilisateur.
À terme: Pendant la phase de développement, une interface textuelle interactive y est également lancée, afin de:
- Apporter un peu d’aide visuelle à l’utilisateur.
- Afin d’accéder à la base de données pour y faire des modifications.
- Afin de pouvoir tester les requêtes HTTP.
sourcepub fn with_user_state(self, data: UserState::UserData) -> Self
pub fn with_user_state(self, data: UserState::UserData) -> Self
Définit les paramètres utilisateur de l’état.
Auto Trait Implementations§
impl<UserState> !RefUnwindSafe for Server<UserState>
impl<UserState> Send for Server<UserState>where UserState: Send,
impl<UserState> !Sync for Server<UserState>
impl<UserState> Unpin for Server<UserState>where UserState: Unpin,
impl<UserState> !UnwindSafe for Server<UserState>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more