pub struct SolarSail<S, H> { /* private fields */ }
Implementations
sourceimpl<S, H> SolarSail<S, H>
impl<S, H> SolarSail<S, H>
pub fn new(state: S, handler: H) -> Self
pub async fn run<F>(self, addr: &SocketAddr) -> Result<(), Error> where
S: Clone + Send + Sync + 'static,
H: Fn(S, Request) -> F + Clone + Send + Sync + 'static,
F: Future<Output = Response> + Send + 'static,
pub async fn run_in<F, L, B>(
self,
addr: &SocketAddr,
layer: L
) -> Result<(), Error> where
S: Clone + Send + Sync + 'static,
H: Fn(S, Request) -> F + Clone + Send + Sync + 'static,
F: Future<Output = Response> + Send + 'static,
L: Layer<Self>,
L::Service: Service<Request<Body>, Response = Response<B>> + Clone + Send + Sync + 'static,
<L::Service as Service<Request<Body>>>::Future: Send,
<L::Service as Service<Request<Body>>>::Error: Error + Send + Sync,
B: HttpBody + Send + Sync + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
Trait Implementations
sourceimpl<S, H> Service<&'_ AddrStream> for SolarSail<S, H> where
S: Clone,
H: Clone,
impl<S, H> Service<&'_ AddrStream> for SolarSail<S, H> where
S: Clone,
H: Clone,
sourceimpl<S, H, F> Service<Request<Body>> for SolarSail<S, H> where
S: Clone + Send + Sync + 'static,
H: Fn(S, Request) -> F + Clone + Send + Sync + 'static,
F: Future<Output = Response> + Send + 'static,
impl<S, H, F> Service<Request<Body>> for SolarSail<S, H> where
S: Clone + Send + Sync + 'static,
H: Fn(S, Request) -> F + Clone + Send + Sync + 'static,
F: Future<Output = Response> + Send + 'static,
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>
The future response value.
Auto Trait Implementations
impl<S, H> RefUnwindSafe for SolarSail<S, H> where
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, H> Send for SolarSail<S, H> where
H: Send,
S: Send,
impl<S, H> Sync for SolarSail<S, H> where
H: Sync,
S: Sync,
impl<S, H> Unpin for SolarSail<S, H> where
H: Unpin,
S: Unpin,
impl<S, H> UnwindSafe for SolarSail<S, H> where
H: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more