Skip to main content

SyncView

Struct SyncView 

1.101.0 · Source
pub struct SyncView<T>
where T: ?Sized,
{ /* private fields */ }
Expand description

SyncView provides mutable access, also referred to as exclusive access to the underlying value. However, it only permits immutable, or shared access to the underlying value when that value is Sync.

While this may seem not very useful, it allows SyncView to unconditionally implement Sync. Indeed, the safety requirements of Sync state that for SyncView to be Sync, it must be sound to share across threads, that is, it must be sound for &SyncView to cross thread boundaries. By design, a &SyncView<T> for non-Sync T has no API whatsoever, making it useless, thus harmless, thus memory safe.

Certain constructs like Futures can only be used with exclusive access, and are often Send but not Sync, so SyncView can be used as hint to the Rust compiler that something is Sync in practice.

§Examples

A non-Sync field prevents the wrapping struct from being Sync:

ⓘ
use std::sync::mpsc::{self, Receiver};

struct Inbox {
    name: &'static str,
    receiver: Receiver<u32>,
}

fn require_send<T: Send>() {}
fn require_send_sync<T: Send + Sync>() {}

require_send::<Inbox>();      // compiled
require_send_sync::<Inbox>(); // compile-failed

SyncView makes the value Sync without stripping the struct of its functionality:

ⓘ
use std::sync::SyncView;
use std::sync::mpsc::{self, Receiver};
use std::thread;

struct Inbox {
    name: &'static str,
    receiver: SyncView<Receiver<u32>>,
}

impl Inbox {
    fn name(&self) -> &'static str {
        self.name
    }

    fn recv(&mut self) -> u32 {
        self.receiver.as_mut().recv().unwrap()
    }
}

let (sender, receiver) = mpsc::channel();
let mut inbox = Inbox { name: "jobs", receiver: SyncView::new(receiver) };
sender.send(42).unwrap();
drop(sender);

thread::scope(|scope| {
    let reader = scope.spawn(|| inbox.name());
    assert_eq!(inbox.name(), "jobs");
    assert_eq!(reader.join().unwrap(), "jobs");
});

let message = thread::spawn(move || inbox.recv()).join().unwrap();
assert_eq!(message, 42);
println!("Shared Inbox across threads, then moved it to a worker and received 42");

§Parallels with a mutex

In some sense, SyncView can be thought of as a compile-time version of a mutex, as the borrow-checker guarantees that only one &mut can exist for any value. This is a parallel with the fact that & and &mut references together can be thought of as a compile-time version of a read-write lock.

Implementations§

Source§

impl<T> SyncView<T>

1.101.0 (const: 1.101.0) · Source

pub const fn new(t: T) -> SyncView<T> ⓘ

Wrap a value in an SyncView

1.101.0 (const: 1.101.0) · Source

pub const fn into_inner(self) -> T

Unwrap the value contained in the SyncView

Source§

impl<T> SyncView<T>
where T: ?Sized,

1.101.0 (const: 1.101.0) · Source

pub const fn as_pin_mut(self: Pin<&mut SyncView<T>>) -> Pin<&mut T>

Gets pinned exclusive access to the underlying value.

SyncView is considered to structurally pin the underlying value, which means unpinned SyncViews can produce unpinned access to the underlying value, but pinned SyncViews only produce pinned access to the underlying value.

1.101.0 (const: 1.101.0) · Source

pub const fn from_mut(r: &mut T) -> &mut SyncView<T> ⓘ

Build a mutable reference to an SyncView<T> from a mutable reference to a T. This allows you to skip building an SyncView with SyncView::new.

1.101.0 (const: 1.101.0) · Source

pub const fn from_pin_mut(r: Pin<&mut T>) -> Pin<&mut SyncView<T>>

Build a pinned mutable reference to an SyncView<T> from a pinned mutable reference to a T. This allows you to skip building an SyncView with SyncView::new.

Source§

impl<T> SyncView<T>
where T: Sync + ?Sized,

1.101.0 (const: 1.101.0) · Source

pub const fn as_pin_ref(self: Pin<&SyncView<T>>) -> Pin<&T>

Gets pinned shared access to the underlying value.

SyncView is considered to structurally pin the underlying value, which means unpinned SyncViews can produce unpinned access to the underlying value, but pinned SyncViews only produce pinned access to the underlying value.

Trait Implementations§

1.101.0 (const: unstable) · Source§

impl<T> AsMut<T> for SyncView<T>
where T: ?Sized,

Source§

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

Gets exclusive access to the underlying value.

1.101.0 (const: unstable) · Source§

impl<T> AsRef<T> for SyncView<T>
where T: Sync + ?Sized,

Source§

fn as_ref(&self) -> &T

Gets shared access to the underlying value.

1.101.0 · Source§

impl<F, Args> AsyncFn<Args> for SyncView<F>
where F: Sync + AsyncFn<Args>, Args: Tuple,

Source§

extern "rust-call" fn async_call( &self, args: Args, ) -> <SyncView<F> as AsyncFnMut<Args>>::CallRefFuture<'_> ⓘ

🔬This is a nightly-only experimental API. (async_fn_traits)
Call the AsyncFn, returning a future which may borrow from the called closure.
1.101.0 · Source§

impl<F, Args> AsyncFnMut<Args> for SyncView<F>
where F: AsyncFnMut<Args>, Args: Tuple,

Source§

type CallRefFuture<'a> = <F as AsyncFnMut<Args>>::CallRefFuture<'a> where F: 'a

🔬This is a nightly-only experimental API. (async_fn_traits)
Source§

extern "rust-call" fn async_call_mut( &mut self, args: Args, ) -> <SyncView<F> as AsyncFnMut<Args>>::CallRefFuture<'_> ⓘ

🔬This is a nightly-only experimental API. (async_fn_traits)
Call the AsyncFnMut, returning a future which may borrow from the called closure.
1.101.0 · Source§

impl<F, Args> AsyncFnOnce<Args> for SyncView<F>
where F: AsyncFnOnce<Args>, Args: Tuple,

Source§

type CallOnceFuture = <F as AsyncFnOnce<Args>>::CallOnceFuture

🔬This is a nightly-only experimental API. (async_fn_traits)
Future returned by AsyncFnOnce::async_call_once.
Source§

type Output = <F as AsyncFnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (async_fn_traits)
Output type of the called closure’s future.
Source§

extern "rust-call" fn async_call_once( self, args: Args, ) -> <SyncView<F> as AsyncFnOnce<Args>>::CallOnceFuture ⓘ

🔬This is a nightly-only experimental API. (async_fn_traits)
Call the AsyncFnOnce, returning a future which may move out of the called closure.
1.101.0 (const: unstable) · Source§

impl<T> Clone for SyncView<T>
where T: Sync + Clone,

Source§

fn clone(&self) -> SyncView<T> ⓘ

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
1.101.0 · Source§

impl<T> Copy for SyncView<T>
where T: Sync + Copy,

Source§

impl<R, G> Coroutine<R> for SyncView<G>
where G: Coroutine<R> + ?Sized,

Source§

type Yield = <G as Coroutine<R>>::Yield

🔬This is a nightly-only experimental API. (coroutine_trait)
The type of value this coroutine yields. Read more
Source§

type Return = <G as Coroutine<R>>::Return

🔬This is a nightly-only experimental API. (coroutine_trait)
The type of value this coroutine returns. Read more
Source§

fn resume( self: Pin<&mut SyncView<G>>, arg: R, ) -> CoroutineState<<SyncView<G> as Coroutine<R>>::Yield, <SyncView<G> as Coroutine<R>>::Return>

🔬This is a nightly-only experimental API. (coroutine_trait)
Resumes the execution of this coroutine. Read more
1.101.0 · Source§

impl<T> Debug for SyncView<T>
where T: ?Sized,

Source§

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

Formats the value using the given formatter. Read more
1.101.0 (const: unstable) · Source§

impl<T> Default for SyncView<T>
where T: Default,

Source§

fn default() -> SyncView<T> ⓘ

Returns the “default value” for a type. Read more
1.101.0 (const: unstable) · Source§

impl<T> Eq for SyncView<T>
where T: Sync + Eq + ?Sized,

1.101.0 (const: unstable) · Source§

impl<F, Args> Fn<Args> for SyncView<F>
where F: Sync + Fn<Args>, Args: Tuple,

Source§

extern "rust-call" fn call( &self, args: Args, ) -> <SyncView<F> as FnOnce<Args>>::Output ⓘ

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
1.101.0 (const: unstable) · Source§

impl<F, Args> FnMut<Args> for SyncView<F>
where F: FnMut<Args>, Args: Tuple,

Source§

extern "rust-call" fn call_mut( &mut self, args: Args, ) -> <SyncView<F> as FnOnce<Args>>::Output ⓘ

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
1.101.0 (const: unstable) · Source§

impl<F, Args> FnOnce<Args> for SyncView<F>
where F: FnOnce<Args>, Args: Tuple,

Source§

type Output = <F as FnOnce<Args>>::Output

The returned type after the call operator is used.
Source§

extern "rust-call" fn call_once( self, args: Args, ) -> <SyncView<F> as FnOnce<Args>>::Output ⓘ

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
1.101.0 (const: unstable) · Source§

impl<T> From<T> for SyncView<T>

Source§

fn from(t: T) -> SyncView<T> ⓘ

Converts to this type from the input type.
1.101.0 · Source§

impl<T> Future for SyncView<T>
where T: Future + ?Sized,

Source§

type Output = <T as Future>::Output

The type of value produced on completion.
Source§

fn poll( self: Pin<&mut SyncView<T>>, cx: &mut Context<'_>, ) -> Poll<<SyncView<T> as Future>::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
1.101.0 · Source§

impl<T> Hash for SyncView<T>
where T: Sync + Hash + ?Sized,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
1.101.0 (const: unstable) · Source§

impl<T> Ord for SyncView<T>
where T: Sync + Ord + ?Sized,

Source§

fn cmp(&self, other: &SyncView<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
1.101.0 (const: unstable) · Source§

impl<T, U> PartialEq<SyncView<U>> for SyncView<T>
where T: Sync + PartialEq<U> + ?Sized, U: Sync + ?Sized,

Source§

fn eq(&self, other: &SyncView<U>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
1.101.0 (const: unstable) · Source§

impl<T, U> PartialOrd<SyncView<U>> for SyncView<T>
where T: Sync + PartialOrd<U> + ?Sized, U: Sync + ?Sized,

Source§

fn partial_cmp(&self, other: &SyncView<U>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
1.101.0 · Source§

impl<T> StructuralPartialEq for SyncView<T>

1.101.0 · Source§

impl<T> Sync for SyncView<T>
where T: ?Sized,

Auto Trait Implementations§

§

impl<T> Freeze for SyncView<T>
where T: Freeze + ?Sized,

§

impl<T> RefUnwindSafe for SyncView<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for SyncView<T>
where T: Send + ?Sized,

§

impl<T> Unpin for SyncView<T>
where T: Unpin + ?Sized,

§

impl<T> UnsafeUnpin for SyncView<T>
where T: UnsafeUnpin + ?Sized,

§

impl<T> UnwindSafe for SyncView<T>
where T: UnwindSafe + ?Sized,

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<F, T, U, R, E> AsyncPredicate<T> for F
where F: FnMut(T) -> U, U: Future<Output = Result<R, E>>, E: Into<Box<dyn Error + Sync + Send>>,

Source§

type Future = ErrInto<U, Box<dyn Error + Sync + Send>>

The future returned by check.
Source§

type Request = R

The type of requests returned by check. Read more
Source§

fn check(&mut self, request: T) -> <F as AsyncPredicate<T>>::Future

Check whether the given request should be forwarded. 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<F> BrokenLinkCallback for F

Source§

fn resolve( &self, broken_link_reference: BrokenLinkReference<'_>, ) -> Option<ResolvedReference>

Potentially resolve a single broken link reference.
Source§

impl<F> Callback for F

Source§

fn on_request( self, request: &Request<()>, response: Response<()>, ) -> Result<Response<()>, Response<Option<String>>>

Called whenever the server read the request from the client and is ready to reply to it. May return additional reply headers. Returning an error resulting in rejecting the incoming connection.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<C, F> ContainsToken<C> for F
where F: Fn(C) -> bool,

Source§

fn contains_token(&self, token: C) -> bool

Returns true if self contains the token
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<F> ErrorSink for F
where F: FnMut(ParseError),

Source§

fn report_error(&mut self, error: ParseError)

Source§

impl<F> EventHandler for F
where F: FnMut(Result<Event, Error>) + Send + 'static,

Source§

fn handle_event(&mut self, event: Result<Event, Error>)

Handles an event.
Source§

impl<F> EventReceiver for F
where F: FnMut(Event),

Source§

fn std_table_open(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn std_table_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn array_table_open(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn array_table_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn inline_table_open(&mut self, span: Span, _error: &mut dyn ErrorSink) -> bool

Returns if entering the inline table is allowed
Source§

fn inline_table_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn array_open(&mut self, span: Span, _error: &mut dyn ErrorSink) -> bool

Returns if entering the array is allowed
Source§

fn array_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn simple_key( &mut self, span: Span, encoding: Option<Encoding>, _error: &mut dyn ErrorSink, )

Source§

fn key_sep(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn key_val_sep(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn scalar( &mut self, span: Span, encoding: Option<Encoding>, _error: &mut dyn ErrorSink, )

Source§

fn value_sep(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn whitespace(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn comment(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn newline(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn error(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

impl<Func, Arg, Res> Filter<Arg, Res> for Func
where Func: Fn(Arg, Kwargs, &State<'_>) -> Res + Sync + Send + 'static, Arg: for<'a> ArgFromValue<'a>, Res: FunctionResult,

Source§

fn call(&self, value: Arg, kwargs: Kwargs, state: &State<'_>) -> Res

The filter function type definition
Source§

fn is_safe(&self) -> bool

Whether the current filter’s output should be treated as safe, defaults to false Only needs to be defined if the filter returns a string
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<Func, Res> Function<Res> for Func
where Func: Fn(Kwargs, &State<'_>) -> Res + Sync + Send + 'static, Res: FunctionResult,

Source§

fn call(&self, kwargs: Kwargs, state: &State<'_>) -> Res

The function type definition
Source§

fn is_safe(&self) -> bool

Whether the current function’s output should be treated as safe, defaults to false Only needs to be defined if the filter returns a string
Source§

impl<T> FutureExt for T
where T: Future + ?Sized,

Source§

fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
where F: FnOnce(Self::Output) -> U, Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type. Read more
Source§

fn map_into<U>(self) -> MapInto<Self, U> ⓘ
where Self::Output: Into<U>, Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type. Read more
Source§

fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
where F: FnOnce(Self::Output) -> Fut, Fut: Future, Self: Sized,

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more
Source§

fn left_future<B>(self) -> Either<Self, B> ⓘ
where B: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the left-hand variant of that Either. Read more
Source§

fn right_future<A>(self) -> Either<A, Self> ⓘ
where A: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the right-hand variant of that Either. Read more
Source§

fn into_stream(self) -> IntoStream<Self>
where Self: Sized,

Convert this future into a single element stream. Read more
Source§

fn flatten(self) -> Flatten<Self> ⓘ
where Self::Output: Future, Self: Sized,

Flatten the execution of this future when the output of this future is itself another future. Read more
Source§

fn flatten_stream(self) -> FlattenStream<Self>
where Self::Output: Stream, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
Source§

fn fuse(self) -> Fuse<Self> ⓘ
where Self: Sized,

Fuse a future such that poll will never again be called once it has completed. This method can be used to turn any Future into a FusedFuture. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
where F: FnOnce(&Self::Output), Self: Sized,

Do something with the output of a future before passing it on. Read more
Source§

fn catch_unwind(self) -> CatchUnwind<Self> ⓘ
where Self: Sized + UnwindSafe,

Catches unwinding panics while polling the future. Read more
Source§

fn shared(self) -> Shared<Self> ⓘ
where Self: Sized, Self::Output: Clone,

Create a cloneable handle to this future where all handles will resolve to the same result. Read more
Source§

fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
where Self: Sized,

Turn this future into a future that yields () on completion and sends its output to another future on a separate task. Read more
Source§

fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
where Self: Sized + Send + 'a,

Wrap the future in a Box, pinning it. Read more
Source§

fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>
where Self: Sized + 'a,

Wrap the future in a Box, pinning it. Read more
Source§

fn unit_error(self) -> UnitError<Self> ⓘ
where Self: Sized,

Source§

fn never_error(self) -> NeverError<Self> ⓘ
where Self: Sized,

Source§

fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>
where Self: Unpin,

A convenience for calling Future::poll on Unpin future types.
Source§

fn now_or_never(self) -> Option<Self::Output>
where Self: Sized,

Evaluates and consumes the future, returning the resulting output if the future is ready after the first call to Future::poll. Read more
Source§

impl<T> FutureExt for T
where T: Future + ?Sized,

Source§

fn with_cancellation_token( self, cancellation_token: &CancellationToken, ) -> WithCancellationTokenFuture<'_, Self>
where Self: Sized,

Similar to CancellationToken::run_until_cancelled, but with the advantage that it is easier to write fluent call chains. Read more
Source§

fn with_cancellation_token_owned( self, cancellation_token: CancellationToken, ) -> WithCancellationTokenFutureOwned<Self>
where Self: Sized,

Similar to CancellationToken::run_until_cancelled_owned, but with the advantage that it is easier to write fluent call chains. Read more
Source§

impl<F, P> GetPixel for F
where F: Sync + Fn(Vec2<usize>) -> P,

Source§

type Pixel = P

The pixel tuple containing f32, f16, u32 and Sample values. The length of the tuple must match the number of channels in the image.
Source§

fn get_pixel(&self, position: Vec2<usize>) -> P

Inspect a single pixel at the requested position. Will be called exactly once for each pixel in the image. The position will not exceed the image dimensions. Might be called from multiple threads at the same time.
Source§

impl<F, Fut, Res, S> Handler<((),), S> for F
where F: FnOnce() -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, Res: IntoResponse,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, _req: Request<Body>, _state: S, ) -> <F as Handler<((),), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1> Handler<(M, T1), S> for F
where F: FnOnce(T1) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2> Handler<(M, T1, T2), S> for F
where F: FnOnce(T1, T2) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3> Handler<(M, T1, T2, T3), S> for F
where F: FnOnce(T1, T2, T3) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4> Handler<(M, T1, T2, T3, T4), S> for F
where F: FnOnce(T1, T2, T3, T4) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5> Handler<(M, T1, T2, T3, T4, T5), S> for F
where F: FnOnce(T1, T2, T3, T4, T5) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6> Handler<(M, T1, T2, T3, T4, T5, T6), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7> Handler<(M, T1, T2, T3, T4, T5, T6, T7), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequestParts<S> + Send, T11: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequestParts<S> + Send, T11: FromRequestParts<S> + Send, T12: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequestParts<S> + Send, T11: FromRequestParts<S> + Send, T12: FromRequestParts<S> + Send, T13: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequestParts<S> + Send, T11: FromRequestParts<S> + Send, T12: FromRequestParts<S> + Send, T13: FromRequestParts<S> + Send, T14: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequestParts<S> + Send, T11: FromRequestParts<S> + Send, T12: FromRequestParts<S> + Send, T13: FromRequestParts<S> + Send, T14: FromRequestParts<S> + Send, T15: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoResponse, T1: FromRequestParts<S> + Send, T2: FromRequestParts<S> + Send, T3: FromRequestParts<S> + Send, T4: FromRequestParts<S> + Send, T5: FromRequestParts<S> + Send, T6: FromRequestParts<S> + Send, T7: FromRequestParts<S> + Send, T8: FromRequestParts<S> + Send, T9: FromRequestParts<S> + Send, T10: FromRequestParts<S> + Send, T11: FromRequestParts<S> + Send, T12: FromRequestParts<S> + Send, T13: FromRequestParts<S> + Send, T14: FromRequestParts<S> + Send, T15: FromRequestParts<S> + Send, T16: FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

The type of future calling this handler returns.
Source§

fn call( self, req: Request<Body>, state: S, ) -> <F as Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<H, T> HandlerWithoutStateExt<T> for H
where H: Handler<T, ()>,

Source§

fn into_service(self) -> HandlerService<H, T, ()>

Convert the handler into a Service and no state.
Source§

fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>

Convert the handler into a MakeService and no state. Read more
Source§

fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>

Convert the handler into a MakeService which stores information about the incoming connection and has no state. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
Source§

impl<I> IntoResettable<ValueParser> for I
where I: Into<ValueParser>,

Source§

fn into_resettable(self) -> Resettable<ValueParser>

Convert to the intended resettable type
Source§

impl<R, F> NullaryFnOnce for F
where F: FnOnce() -> R,

Source§

type Output = R

Source§

fn call(self) -> <F as NullaryFnOnce>::Output

Source§

impl<F> OnFailedUpgrade for F
where F: FnOnce(Error) + Send + 'static,

Source§

fn call(self, error: Error)

Call the callback.
Source§

impl<F, T> Parser for F
where F: FnOnce(&ParseBuffer<'_>) -> Result<T, Error>,

Source§

type Output = T

Source§

fn parse2(self, tokens: TokenStream) -> Result<T, Error>

Parse a proc-macro2 token stream into the chosen syntax tree node. Read more
Source§

fn __parse_scoped( self, scope: Span, tokens: TokenStream, ) -> Result<<F as Parser>::Output, Error>

Source§

fn parse(self, tokens: TokenStream) -> Result<Self::Output, Error>

Parse tokens of source code into the chosen syntax tree node. Read more
Source§

fn parse_str(self, s: &str) -> Result<Self::Output, Error>

Parse a string of Rust code into the chosen syntax tree node. Read more
Source§

impl<F, T> Parser for F
where F: FnOnce(&ParseBuffer<'_>) -> Result<T, Error>,

Source§

type Output = T

Source§

fn parse2(self, tokens: TokenStream) -> Result<T, Error>

Parse a proc-macro2 token stream into the chosen syntax tree node. Read more
Source§

fn __parse_scoped( self, scope: Span, tokens: TokenStream, ) -> Result<<F as Parser>::Output, Error>

Source§

fn parse_str(self, s: &str) -> Result<Self::Output, Error>

Parse a string of Rust code into the chosen syntax tree node. Read more
Source§

impl<'a, I, O, E, F> Parser<I, O, E> for F
where F: FnMut(I) -> Result<(I, O), Err<E>> + 'a,

Source§

fn parse(&mut self, i: I) -> Result<(I, O), Err<E>>

A parser takes in input type, and returns a Result containing either the remaining input and the output value, or an error
Source§

fn map<G, O2>(self, g: G) -> Map<Self, G, O>
where G: Fn(O) -> O2, Self: Sized,

Maps a function over the result of a parser
Source§

fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>
where G: FnMut(O) -> H, H: Parser<I, O2, E>, Self: Sized,

Creates a second parser from the output of the first one, then apply over the rest of the input
Source§

fn and_then<G, O2>(self, g: G) -> AndThen<Self, G, O>
where G: Parser<O, O2, E>, Self: Sized,

Applies a second parser over the output of the first one
Source§

fn and<G, O2>(self, g: G) -> And<Self, G>
where G: Parser<I, O2, E>, Self: Sized,

Applies a second parser after the first one, return their results as a tuple
Source§

fn or<G>(self, g: G) -> Or<Self, G>
where G: Parser<I, O, E>, Self: Sized,

Applies a second parser over the input if the first one failed
Source§

fn into<O2, E2>(self) -> Into<Self, O, O2, E, E2>
where O2: From<O>, E2: From<E>, Self: Sized,

automatically converts the parser’s output and error values to another type, as long as they implement the From trait
Source§

impl<I, O, E, F> Parser<I> for F
where E: ParseError<I>, F: FnMut(I) -> Result<(I, O), Err<E>>,

Source§

type Output = O

Type of the produced value
Source§

type Error = E

Error type of this parser
Source§

fn process<OM>( &mut self, i: I, ) -> Result<(I, <<OM as OutputMode>::Output as Mode>::Output<<F as Parser<I>>::Output>), Err<<F as Parser<I>>::Error, <<OM as OutputMode>::Error as Mode>::Output<<F as Parser<I>>::Error>>>
where OM: OutputMode,

A parser takes in input type, and returns a Result containing either the remaining input and the output value, or an error
Source§

fn parse( &mut self, input: Input, ) -> Result<(Input, Self::Output), Err<Self::Error>>

A parser takes in input type, and returns a Result containing either the remaining input and the output value, or an error
Source§

fn parse_complete( &mut self, input: Input, ) -> Result<(Input, Self::Output), Err<Self::Error>>

A parser takes in input type, and returns a Result containing either the remaining input and the output value, or an error
Source§

fn map<G, O2>(self, g: G) -> Map<Self, G>
where G: FnMut(Self::Output) -> O2, Self: Sized,

Maps a function over the result of a parser
Source§

fn map_res<G, O2, E2>(self, g: G) -> MapRes<Self, G>
where G: FnMut(Self::Output) -> Result<O2, E2>, Self::Error: FromExternalError<Input, E2>, Self: Sized,

Applies a function returning a Result over the result of a parser.
Source§

fn map_opt<G, O2>(self, g: G) -> MapOpt<Self, G>
where G: FnMut(Self::Output) -> Option<O2>, Self: Sized,

Applies a function returning an Option over the result of a parser.
Source§

fn flat_map<G, H>(self, g: G) -> FlatMap<Self, G>
where G: FnMut(Self::Output) -> H, H: Parser<Input, Error = Self::Error>, Self: Sized,

Creates a second parser from the output of the first one, then apply over the rest of the input
Source§

fn and_then<G>(self, g: G) -> AndThen<Self, G>
where G: Parser<Self::Output, Error = Self::Error>, Self: Sized,

Applies a second parser over the output of the first one
Source§

fn and<G, O2>(self, g: G) -> And<Self, G>
where G: Parser<Input, Output = O2, Error = Self::Error>, Self: Sized,

Applies a second parser after the first one, return their results as a tuple
Source§

fn or<G>(self, g: G) -> Or<Self, G>
where G: Parser<Input, Output = Self::Output, Error = Self::Error>, Self: Sized,

Applies a second parser over the input if the first one failed
Source§

fn into<O2, E2>(self) -> Into<Self, O2, E2>
where O2: From<Self::Output>, E2: From<Self::Error>, Self: Sized,

automatically converts the parser’s output and error values to another type, as long as they implement the From trait
Source§

impl<F> Pattern for F
where F: FnMut(char) -> bool,

Source§

type Searcher<'a> = CharPredicateSearcher<'a, F>

🔬This is a nightly-only experimental API. (pattern)
Associated searcher for this pattern
Source§

fn into_searcher<'a>(self, haystack: &'a str) -> CharPredicateSearcher<'a, F>

🔬This is a nightly-only experimental API. (pattern)
Constructs the associated searcher from self and the haystack to search in.
Source§

fn is_contained_in<'a>(self, haystack: &'a str) -> bool

🔬This is a nightly-only experimental API. (pattern)
Checks whether the pattern matches anywhere in the haystack
Source§

fn is_prefix_of<'a>(self, haystack: &'a str) -> bool

🔬This is a nightly-only experimental API. (pattern)
Checks whether the pattern matches at the front of the haystack
Source§

fn strip_prefix_of<'a>(self, haystack: &'a str) -> Option<&'a str>

🔬This is a nightly-only experimental API. (pattern)
Removes the pattern from the front of haystack, if it matches.
Source§

fn is_suffix_of<'a>(self, haystack: &'a str) -> bool

🔬This is a nightly-only experimental API. (pattern)
Checks whether the pattern matches at the back of the haystack
Source§

fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>

🔬This is a nightly-only experimental API. (pattern)
Removes the pattern from the back of haystack, if it matches.
Source§

fn as_utf8_pattern(&self) -> Option<Utf8Pattern<'_>>

🔬This is a nightly-only experimental API. (pattern)
Returns the pattern as UTF-8 if possible.
Source§

impl<F, T> Peek for F
where F: Copy + FnOnce(TokenMarker) -> T, T: Token,

Source§

type Token = T

Source§

impl<F, T> Peek for F
where F: Copy + FnOnce(TokenMarker) -> T, T: Token,

Source§

type Token = T

Source§

impl<S, F, Req> Picker<S, Req> for F
where F: Fn(&Req, &[S]) -> usize,

Source§

fn pick(&mut self, r: &Req, services: &[S]) -> usize

Return an index into the iterator of Service passed to Steer::new.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

fn C(&self) -> T

Source§

impl<T> PowerToOwned for T
where T: ToOwned + ?Sized,

Source§

type Owned = <T as ToOwned>::Owned

Source§

fn O(&self) -> <T as PowerToOwned>::Owned

Source§

impl<F, T, R, E> Predicate<T> for F
where F: FnMut(T) -> Result<R, E>, E: Into<Box<dyn Error + Sync + Send>>,

Source§

type Request = R

The type of requests returned by check. Read more
Source§

fn check( &mut self, request: T, ) -> Result<<F as Predicate<T>>::Request, Box<dyn Error + Sync + Send>>

Check whether the given request should be forwarded. Read more
Source§

impl<F> ProgressTracker for F
where F: Fn(&ProgressState, &mut dyn Write) + Send + Sync + Clone + 'static,

Source§

fn clone_box(&self) -> Box<dyn ProgressTracker>

Creates a new instance of the progress tracker
Source§

fn tick(&mut self, _: &ProgressState, _: Instant)

Notifies the progress tracker of a tick event
Source§

fn reset(&mut self, _: &ProgressState, _: Instant)

Notifies the progress tracker of a reset event
Source§

fn write(&self, state: &ProgressState, w: &mut dyn Write)

Provides access to the progress bar display buffer for custom messages
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<F, T> Replacer for F
where F: FnMut(&Captures<'_>) -> T, T: AsRef<[u8]>,

Source§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut Vec<u8>)

Appends possibly empty data to dst to replace the current match. Read more
Source§

fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, [u8]>>

Return a fixed unchanging replacement byte string. Read more
Source§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps this Replacer. Read more
Source§

impl<F, T> Replacer for F
where F: FnMut(&Captures<'_>) -> T, T: AsRef<str>,

Source§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut String)

Appends possibly empty data to dst to replace the current match. Read more
Source§

fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, str>>

Return a fixed unchanging replacement string. Read more
Source§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps this Replacer. Read more
Source§

impl<F, E> ResolveServerName for F
where F: Fn(&Uri) -> Result<ServerName<'static>, E>, E: Into<Box<dyn Error + Sync + Send>>,

Source§

fn resolve( &self, uri: &Uri, ) -> Result<ServerName<'static>, Box<dyn Error + Sync + Send>>

Maps a Uri into a ServerName.
Source§

impl<F> RootDirFilter for F
where F: Fn(&Path) -> bool,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<F> ScanEventHandler for F
where F: FnMut(Result<PathBuf, Error>) + Send + 'static,

Source§

fn handle_event(&mut self, event: Result<PathBuf, Error>)

Handles an event.
Source§

impl<Func, Arg, Res> Test<Arg, Res> for Func
where Func: Fn(Arg, Kwargs, &State<'_>) -> Res + Sync + Send + 'static, Arg: for<'a> ArgFromValue<'a>, Res: TestResult,

Source§

fn call(&self, value: Arg, kwargs: Kwargs, state: &State<'_>) -> Res

The test function type definition
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 = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<F, T, E> TryFuture for F
where F: Future<Output = Result<T, E>> + ?Sized,

Source§

type Ok = T

The type of successful values yielded by this future
Source§

type Error = E

The type of failures yielded by this future
Source§

fn try_poll( self: Pin<&mut F>, cx: &mut Context<'_>, ) -> Poll<<F as Future>::Output>

Poll this TryFuture as if it were a Future. Read more
Source§

impl<Fut> TryFutureExt for Fut
where Fut: TryFuture + ?Sized,

Source§

fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
where Self::Ok: Sink<Item, Error = Self::Error>, Self: Sized,

Flattens the execution of this future when the successful result of this future is a Sink. Read more
Source§

fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> ⓘ
where F: FnOnce(Self::Ok) -> T, Self: Sized,

Maps this future’s success value to a different value. Read more
Source§

fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> ⓘ
where F: FnOnce(Self::Ok) -> T, E: FnOnce(Self::Error) -> T, Self: Sized,

Maps this future’s success value to a different value, and permits for error handling resulting in the same type. Read more
Source§

fn map_err<E, F>(self, f: F) -> MapErr<Self, F> ⓘ
where F: FnOnce(Self::Error) -> E, Self: Sized,

Maps this future’s error value to a different value. Read more
Source§

fn err_into<E>(self) -> ErrInto<Self, E> ⓘ
where Self: Sized, Self::Error: Into<E>,

Maps this future’s Error to a new error type using the Into trait. Read more
Source§

fn ok_into<U>(self) -> OkInto<Self, U> ⓘ
where Self: Sized, Self::Ok: Into<U>,

Maps this future’s Ok to a new type using the Into trait.
Source§

fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> ⓘ
where F: FnOnce(Self::Ok) -> Fut, Fut: TryFuture<Error = Self::Error>, Self: Sized,

Executes another future after this one resolves successfully. The success value is passed to a closure to create this subsequent future. Read more
Source§

fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> ⓘ
where F: FnOnce(Self::Error) -> Fut, Fut: TryFuture<Ok = Self::Ok>, Self: Sized,

Executes another future if this one resolves to an error. The error value is passed to a closure to create this subsequent future. Read more
Source§

fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> ⓘ
where F: FnOnce(&Self::Ok), Self: Sized,

Do something with the success value of a future before passing it on. Read more
Source§

fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> ⓘ
where F: FnOnce(&Self::Error), Self: Sized,

Do something with the error value of a future before passing it on. Read more
Source§

fn try_flatten(self) -> TryFlatten<Self, Self::Ok> ⓘ
where Self::Ok: TryFuture<Error = Self::Error>, Self: Sized,

Flatten the execution of this future when the successful result of this future is another future. Read more
Source§

fn try_flatten_stream(self) -> TryFlattenStream<Self>
where Self::Ok: TryStream<Error = Self::Error>, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
Source§

fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> ⓘ
where Self: Sized, F: FnOnce(Self::Error) -> Self::Ok,

Unwraps this future’s output, producing a future with this future’s Ok type as its Output type. Read more
Source§

fn into_future(self) -> IntoFuture<Self> ⓘ
where Self: Sized,

Wraps a TryFuture into a type that implements Future. Read more
Source§

fn try_poll_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::Ok, Self::Error>>
where Self: Unpin,

A convenience method for calling TryFuture::try_poll on Unpin future types.
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<F, T, E> TypedValueParser for F
where F: Fn(&str) -> Result<T, E> + Clone + Send + Sync + 'static, E: Into<Box<dyn Error + Sync + Send>>, T: Send + Sync + Clone,

Source§

type Value = T

Argument’s value type
Source§

fn parse_ref( &self, cmd: &Command, arg: Option<&Arg>, value: &OsStr, ) -> Result<<F as TypedValueParser>::Value, Error>

Parse the argument value Read more
Source§

fn parse_ref_( &self, cmd: &Command, arg: Option<&Arg>, value: &OsStr, _source: ValueSource, ) -> Result<Self::Value, Error>

Parse the argument value Read more
Source§

fn parse( &self, cmd: &Command, arg: Option<&Arg>, value: OsString, ) -> Result<Self::Value, Error>

Parse the argument value Read more
Source§

fn parse_( &self, cmd: &Command, arg: Option<&Arg>, value: OsString, _source: ValueSource, ) -> Result<Self::Value, Error>

Parse the argument value Read more
Source§

fn possible_values( &self, ) -> Option<Box<dyn Iterator<Item = PossibleValue> + '_>>

Reflect on enumerated value properties Read more
Source§

fn map<T, F>(self, func: F) -> MapValueParser<Self, F>
where T: Send + Sync + Clone, F: Fn(Self::Value) -> T + Clone,

Adapt a TypedValueParser from one value to another Read more
Source§

fn try_map<T, E, F>(self, func: F) -> TryMapValueParser<Self, F>
where F: Fn(Self::Value) -> Result<T, E> + Clone + Send + Sync + 'static, T: Send + Sync + Clone, E: Into<Box<dyn Error + Sync + Send>>,

Adapt a TypedValueParser from one value to another Read more
Source§

impl<F> URLRewriter for F
where F: for<'a> Fn(&'a str) -> String + RefUnwindSafe + Send + Sync,

Source§

fn to_html(&self, url: &str) -> String

Converts the given URL from Markdown to its representation when output as HTML.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<F> Visit for F
where F: FnMut(&Field, &dyn Debug),

Source§

fn record_debug(&mut self, field: &Field, value: &dyn Debug)

Visit a value implementing fmt::Debug.
Source§

fn record_f64(&mut self, field: &Field, value: f64)

Visit a double-precision floating point value.
Source§

fn record_i64(&mut self, field: &Field, value: i64)

Visit a signed 64-bit integer value.
Source§

fn record_u64(&mut self, field: &Field, value: u64)

Visit an unsigned 64-bit integer value.
Source§

fn record_i128(&mut self, field: &Field, value: i128)

Visit a signed 128-bit integer value.
Source§

fn record_u128(&mut self, field: &Field, value: u128)

Visit an unsigned 128-bit integer value.
Source§

fn record_bool(&mut self, field: &Field, value: bool)

Visit a boolean value.
Source§

fn record_str(&mut self, field: &Field, value: &str)

Visit a string value.
Source§

fn record_bytes(&mut self, field: &Field, value: &[u8])

Visit a byte slice.
Source§

fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))

Records a type implementing Error. Read more
Source§

impl<F> WithSimd for F
where F: NullaryFnOnce,

Source§

type Output = <F as NullaryFnOnce>::Output

Source§

fn with_simd<S>(self, simd: S) -> <F as WithSimd>::Output
where S: Simd,

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more