Struct Server

Source
pub struct Server { /* private fields */ }

Implementations§

Source§

impl Server

Source

pub fn new() -> Self

Source

pub async fn host(&self, host: &'static str) -> &Self

Source

pub async fn port(&self, port: usize) -> &Self

Source

pub async fn log_dir(&self, log_dir: &'static str) -> &Self

Source

pub async fn log_size(&self, log_size: usize) -> &Self

Source

pub async fn enable_log(&self) -> &Self

Source

pub async fn disable_log(&self) -> &Self

Source

pub async fn http_line_buffer_size(&self, buffer_size: usize) -> &Self

Source

pub async fn websocket_buffer_size(&self, buffer_size: usize) -> &Self

Source

pub async fn inner_print(&self, print: bool) -> &Self

Source

pub async fn inner_log(&self, print: bool) -> &Self

Source

pub async fn enable_inner_print(&self) -> &Self

Source

pub async fn disable_inner_print(&self) -> &Self

Source

pub async fn enable_inner_log(&self) -> &Self

Source

pub async fn disable_inner_log(&self) -> &Self

Source

pub async fn set_nodelay(&self, nodelay: bool) -> &Self

Source

pub async fn enable_nodelay(&self) -> &Self

Source

pub async fn disable_nodelay(&self) -> &Self

Source

pub async fn set_linger(&self, linger: Option<Duration>) -> &Self

Source

pub async fn enable_linger(&self, linger: Duration) -> &Self

Source

pub async fn disable_linger(&self) -> &Self

Source

pub async fn set_ttl(&self, ttl: u32) -> &Self

Source

pub async fn route<R, F, Fut>(&self, route: R, func: F) -> &Self
where R: ToString, F: FuncWithoutPin<Fut>, Fut: Future<Output = ()> + Send + 'static,

Source

pub async fn request_middleware<F, Fut>(&self, func: F) -> &Self
where F: FuncWithoutPin<Fut>, Fut: Future<Output = ()> + Send + 'static,

Source

pub async fn response_middleware<F, Fut>(&self, func: F) -> &Self
where F: FuncWithoutPin<Fut>, Fut: Future<Output = ()> + Send + 'static,

Source

pub async fn listen(&self) -> ServerResult

Source§

impl Server

Source

pub fn get_mut_config(&mut self) -> &mut ArcRwLock<ServerConfig<'static>>

Source

pub fn get_mut_route( &mut self, ) -> &mut ArcRwLock<HashMap<String, Arc<dyn Func>, BuildHasherDefault<XxHash3_64>>>

Source

pub fn get_mut_route_matcher(&mut self) -> &mut ArcRwLock<RouteMatcher>

Source

pub fn get_mut_request_middleware( &mut self, ) -> &mut ArcRwLock<Vec<Arc<dyn Func>>>

Source

pub fn get_mut_response_middleware( &mut self, ) -> &mut ArcRwLock<Vec<Arc<dyn Func>>>

Source

pub fn get_mut_tmp(&mut self) -> &mut ArcRwLock<Tmp>

Trait Implementations§

Source§

impl Clone for Server

Source§

fn clone(&self) -> Server

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

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

Performs copy-assignment from source. Read more
Source§

impl Default for Server

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Server

§

impl !RefUnwindSafe for Server

§

impl Send for Server

§

impl Sync for Server

§

impl Unpin for Server

§

impl !UnwindSafe for Server

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> AnySend for T
where T: Any + Send,

Source§

impl<T> AnySendClone for T
where T: Any + Send + Clone,

Source§

impl<T> AnySendSync for T
where T: Any + Send + Sync,

Source§

impl<T> AnySendSyncClone for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> AnySync for T
where T: Any + Sync,

Source§

impl<T> AnySyncClone for T
where T: Any + Sync + Clone,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T