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) -> Self
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> Freeze for Server<UserState>where
UserState: Freeze,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more