Struct SimpleHttpServer

Source
pub struct SimpleHttpServer<A, F> { /* private fields */ }

Implementations§

Source§

impl<A, F> SimpleHttpServer<A, F>
where A: Clone + Send + 'static, F: Future<Item = (), Error = ()> + Send + 'static,

Source

pub fn new(argument: A, callback: fn(A, RawConnection) -> F) -> Self

Source§

impl<A, F> SimpleHttpServer<A, F>

Source

pub fn max_request_header_count(&mut self, count: usize) -> &mut Self

Source

pub fn min_buffer_size(&mut self, size: usize) -> &mut Self

Source

pub fn max_buffer_size(&mut self, size: usize) -> &mut Self

Trait Implementations§

Source§

impl<A: Debug, F: Debug> Debug for SimpleHttpServer<A, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A, F> Server for SimpleHttpServer<A, F>
where A: Clone + Send + 'static, F: Future<Item = (), Error = ()> + Send + 'static,

Source§

type Transport = TcpStream

Source§

type SocketHandler = RawSocketHandler

Source§

type ConnectionHandler = ConnectionHandleCallback<A, TcpStream, F>

Source§

fn create_handlers(&mut self) -> (Self::SocketHandler, Self::ConnectionHandler)

Source§

fn before_listen(&mut self, listener: &mut TcpListener) -> Result<()>

Source§

fn start<S>(self, bind_addr: SocketAddr, spawner: S) -> ServerHandle
where Self: Sized + Send + 'static, S: Spawn + Clone + Send + 'static,

Auto Trait Implementations§

§

impl<A, F> Freeze for SimpleHttpServer<A, F>
where A: Freeze,

§

impl<A, F> RefUnwindSafe for SimpleHttpServer<A, F>
where A: RefUnwindSafe,

§

impl<A, F> Send for SimpleHttpServer<A, F>
where A: Send,

§

impl<A, F> Sync for SimpleHttpServer<A, F>
where A: Sync,

§

impl<A, F> Unpin for SimpleHttpServer<A, F>
where A: Unpin,

§

impl<A, F> UnwindSafe for SimpleHttpServer<A, F>
where A: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn timeout<E>(self, delay_from_now: Duration) -> Timeout<Self>
where Self: Future<Error = E>, E: From<Error>,

Source§

fn write_all_bytes<B: AsRef<[u8]>>(self, buf: B) -> WriteAllBytes<Self, B>
where Self: Write,

Source§

fn read_all_bytes(self) -> ReadAllBytes<Self>
where Self: Read,

Source§

fn read_all_str(self) -> ReadAllStr<Self>
where Self: Read,

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> IoExt for T

Source§

fn into_body_reader(self) -> Result<BodyReader<Self>>
where Self: Read + Metadata,

Source§

fn max_length(self, max_len: u64) -> MaxLength<Self>
where Self: Read,

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.