pub struct Server<S> { /* private fields */ }Implementations§
Source§impl<S> Server<S>where
S: Service<OxiditeRequest, Response = OxiditeResponse, Error = Error> + Clone + Send + Sync + 'static,
S::Future: Send + 'static,
impl<S> Server<S>where
S: Service<OxiditeRequest, Response = OxiditeResponse, Error = Error> + Clone + Send + Sync + 'static,
S::Future: Send + 'static,
pub fn new(service: S) -> Self
pub fn bind(self, addr: SocketAddr) -> Self
Sourcepub fn with_cors(self, cors_config: CorsConfig) -> Self
pub fn with_cors(self, cors_config: CorsConfig) -> Self
Configure CORS for the server (applies to all responses including errors)
pub async fn run(self) -> Result<()>
pub async fn listen(self, addr: SocketAddr) -> Result<()>
Auto Trait Implementations§
impl<S> Freeze for Server<S>where
S: Freeze,
impl<S> RefUnwindSafe for Server<S>where
S: RefUnwindSafe,
impl<S> Send for Server<S>where
S: Send,
impl<S> Sync for Server<S>where
S: Sync,
impl<S> Unpin for Server<S>where
S: Unpin,
impl<S> UnsafeUnpin for Server<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Server<S>where
S: UnwindSafe,
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