Skip to main content

Request

Struct Request 

Source
pub struct Request { /* private fields */ }
Expand description

An incoming request: its URL, headers, cookies, input, uploaded files, session, and route.

As a handler argument, Request reads the body before the handler runs, so the body input is ready right away. Because it reads the body, Request must be the handler’s last argument. Reading the body fails as load_input does, and the error becomes the response.

You read body input as a type with validate, parse, or json, and read query string parameters with query, so a handler sees only the input the type describes and query parameters never bleed into form or JSON bodies. Uploaded files arrive as UploadedFile fields of a validated type:

#[derive(serde::Deserialize)]
struct Signup {
    name: Option<String>,
    #[serde(default)]
    subscribe: bool,
}

async fn store(request: laravel::http::Request) -> laravel::Result<String> {
    let signup: Signup = request.parse()?;
    let name = signup.name.as_deref().unwrap_or("stranger");

    Ok(format!("Hello, {name}! Subscribed: {}", signup.subscribe))
}

Middleware receive a Request too. In middleware, the body input is empty until something reads the body with load_input. Later middleware and the handler see the input as each middleware leaves it.

To change the input whenever it’s read, without reading the body yourself, use transform_input, as TrimStrings does.

Implementations§

Source§

impl Request

Source

pub async fn user<U>(&self) -> Result<Option<U>, Error>
where U: Authenticatable,

The logged-in user, or None for a guest. This is the user that Auth returns. The request loads the user once, so you get the same user here, through Auth, and through Authenticated:

let user: Option<User> = request.user().await?;
§Errors

Fails as Auth::user does, or when no guard authenticates U.

Source

pub async fn authenticated(&self) -> Result<bool, Error>

Whether a user is logged in, either through a request guard or through the session guard. Unlike user, authenticated doesn’t need the user’s type.

if request.authenticated().await? {
    // ...
}
§Errors

Fails when the session guard can’t load the user, such as when its provider’s query fails.

Source

pub async fn can<U, Args, M>( &self, ability: impl Ability<U, Args, M>, args: Args, ) -> Result<bool, Error>
where U: Authenticatable, Args: Send,

Whether the policy method allows the request’s user to perform the action, checked the way Authorizable::can checks it. A guest is denied unless the method takes an Option<&User>.

let allowed = request.can(PostPolicy::create, ()).await?;
§Errors

Fails when user fails or the policy method fails.

Source

pub async fn authorize<U, Args, M>( &self, ability: impl Ability<U, Args, M>, args: Args, ) -> Result<(), Error>
where U: Authenticatable, Args: Send,

Returns Ok when the policy method allows the request’s user to perform the action, as Authorizable::authorize does. A guest gets a 403 unless the method takes an Option<&User>.

§Errors

Returns the denial’s HTTP error when the policy denies the action. Also fails when user fails or the policy method fails.

Source§

impl Request

Source

pub fn from_http(request: Request<Body>) -> Request

Wrap a request from the http crate. If middleware already read input from the body, that input comes along too.

Source

pub fn into_http(self) -> Request<Body>

Unwrap into a request from the http crate. Input already read from the body stays with the request, so a later from_http doesn’t read the body again.

Source

pub async fn load_input(&mut self) -> Result<(), Error>

Read the body’s JSON or form input, and make a multipart form’s files available to validate. Once the body is read, later calls do nothing.

§Errors

Fails with 413 Content Too Large when the body is larger than its LimitBody, which defaults to 2 MB. It also fails with 413 in three cases: a multipart form is larger than its LimitUploads, which defaults to 16 MB, the form’s text fields together are larger than the LimitBody, or the form has more fields or files than the server config section allows. It fails with 400 Bad Request when the body can’t be read or isn’t valid for its content type.

Source

pub fn transform_input( &mut self, transform: impl Fn(&mut Map<String, Value>) + Send + Sync + 'static, )

Transform the input now, and any body input read later, without reading the body first.

use laravel::http::{Middleware, Next, Request, Response};
use serde_json::Value;

struct LowercaseEmails;

impl Middleware for LowercaseEmails {
    async fn handle(&self, mut request: Request, next: Next) -> laravel::Result<Response> {
        request.transform_input(|input| {
            if let Some(Value::String(email)) = input.get_mut("email") {
                *email = email.to_lowercase();
            }
        });

        Ok(next.run(request).await)
    }
}

Transforms run in the order you add them, so the middleware that runs first transforms the input first. Transforms also apply to query.

Source

pub const fn method(&self) -> &Method

The request method.

Source

pub fn uri(&self) -> &Uri

The URI as the client sent it, before routing strips a nested router’s prefix.

Source

pub fn path(&self) -> &str

The path, such as /users/1.

Source

pub fn url(&self) -> String

The URL without the query string, such as https://example.com/users.

Source

pub fn full_url(&self) -> String

The URL with the query string, such as https://example.com/users?page=2.

Source

pub fn origin(&self) -> String

The scheme and host the request was made to, with any port, such as https://example.com. Behind a trusted proxy, they come from the proxy’s forwarded headers.

Source

pub fn host(&self) -> String

The host the request was made to, without its port, such as example.com. Behind a trusted proxy, it comes from the proxy’s forwarded headers.

Source

pub fn is_secure(&self) -> bool

Whether the request was made over HTTPS. Behind a trusted proxy, the proxy’s forwarded headers decide.

Source

pub fn full_url_with_query<I, K, V>(&self, query: I) -> String
where I: IntoIterator<Item = (K, V)>, K: Into<String>, V: Display,

The full URL with the given query parameters added, replacing any parameters with the same names. Use it for links that change one parameter of the current page:

let sorted_by_name = request.full_url_with_query([("sort", "name")]);

Replacing a list parameter such as tags also removes tags[] and tags[0].

Source

pub fn full_url_without_query<'a>( &self, names: impl IntoIterator<Item = &'a str>, ) -> String

The full URL without the given query parameters. Use it for links that clear part of the current page’s query, such as the page number when a filter changes:

let first_page = request.full_url_without_query(["page"]);
Source

pub fn resembles(&self, pattern: &str) -> bool

Whether the path matches a pattern, where * is a wildcard, as in request.resembles("admin/*"). Leading and trailing slashes don’t matter.

Source

pub fn header(&self, name: impl AsHeaderName) -> Option<&str>

The value of a request header. When the header has several values, this returns the first. Returns None when the header is missing or its value isn’t visible ASCII.

Source

pub const fn headers(&self) -> &HeaderMap

All request headers.

Source

pub const fn headers_mut(&mut self) -> &mut HeaderMap

All request headers, mutably, so you can change them for the rest of the request.

Source

pub fn bearer_token(&self) -> Option<&str>

The token from an Authorization: Bearer header, with the scheme matched in any letter case. Returns None when there’s no such header or the token is empty.

Source

pub fn ip(&self) -> IpAddr

The client’s IP address. Behind a trusted proxy, it’s the address the proxy reports. Otherwise, it’s the address of the peer the server is connected to.

An IPv4 address stays IPv4, even when a server listening on :: sees it as an IPv6 address such as ::ffff:203.0.113.5. When the server doesn’t know the peer, such as for a request built by hand, the address is 0.0.0.0.

Source

pub fn cookie(&self, name: &str) -> Option<String>

A cookie’s value as the browser sent it. On routes in the web group, the value is already decrypted, and a value that fails to decrypt is None. Cookies you attach to a response don’t change the values the request returns.

Source

pub fn encrypter(&self) -> Result<&Encrypter, Error>

The application’s encrypter.

§Errors

Fails when the application has no valid encryption key.

Source

pub fn ajax(&self) -> bool

Whether the request’s X-Requested-With header marks it as an XMLHttpRequest.

Source

pub fn prefetch(&self) -> bool

Whether the browser is prefetching the page. A request is a prefetch when its Purpose, Sec-Purpose, or X-Moz header is prefetch, in any letter case. This includes prerender requests with Sec-Purpose: prefetch;prerender.

Source

pub fn wants_json(&self) -> bool

Whether the most preferred type in the Accept header is JSON, such as application/json or application/vnd.api+json.

Source

pub fn acceptable_types(&self) -> Vec<String>

The content types that the Accept header lists, lowercased and sorted by quality value with the most preferred first. Types that the header rules out with q=0 are left out.

Source

pub fn accepts(&self, types: &[&str]) -> bool

Whether the client accepts any of the given content types. Each type may be a full type, such as "text/csv", or a short name, such as "csv". A request without an Accept header accepts anything.

Source

pub fn prefers<'a>(&self, types: &[&'a str]) -> Option<&'a str>

The type that the client’s Accept header prefers among the given content types. Use it to respond in the format the client asks for, such as Markdown for an agent:

use laravel::http::{IntoResponse, Response};

match request.prefers(&["text/html", "text/markdown"]) {
    Some("text/markdown") => Ok(markdown().with_header("content-type", "text/markdown")),
    _ => Ok(Response::new(laravel::view::view("page", ()))),
}

A type may be a short name, such as "json". A client that asks for a more specific version of a type, such as application/vnd.api+json for "json", prefers that type. A client whose most preferred type is */* prefers the first type you list. Returns None when the client accepts none of the types or sent no Accept header.

Source

pub fn id(&self) -> Option<&str>

The request’s ID, which every log line written while handling the request carries. Returns None for a request that didn’t pass through the application, such as one built by hand. To learn where the ID comes from, check out RequestId.

Source

pub fn extension<T>(&self) -> Option<&T>
where T: Send + Sync + 'static,

A value from the request extensions by its type, such as one an earlier middleware added.

Source

pub const fn extensions_mut(&mut self) -> &mut Extensions

The request extensions, to add values that later middleware and the handler can read.

Source

pub const fn content(&self) -> Option<&Bytes>

The body exactly as the client sent it. Use it to check a signature computed over the original bytes, or to read a body that isn’t a form or JSON:

use laravel::OrAbort;

async fn stripe_webhook(request: laravel::http::Request) -> laravel::Result<&'static str> {
    let signature = request.header("stripe-signature").or_abort(400)?;
    verify(request.content().or_abort(400)?, signature)?;

    Ok("received")
}

Like the input, the body is read before a handler runs, and in middleware once the middleware calls load_input. Until then, content returns None. It also returns None for a multipart body, because a multipart form’s files are written to disk rather than kept in memory.

Source§

impl Request

Source

pub fn inertia(&self) -> Option<Inertia>

The request’s Inertia, or None on routes that don’t run Inertia’s middleware. New applications run it in the web group. An error renderer uses it to render a page, as in request.inertia()?.render("Billing/CardDeclined", props).

Source§

impl Request

Source

pub fn expects_json(&self) -> bool

Whether the client expects a JSON response. That’s the case when the request is for a route in the api group, when the client asked for JSON, or when it made an XMLHttpRequest that prefers no type in particular, such as with Accept: */*.

Source

pub fn current_route(&self) -> Option<&CurrentRoute>

The matched route, once the request has been routed. Returns None before routing, such as in global middleware, or when no route matched.

if let Some(route) = request.current_route() {
    let uri = route.uri();
    let domain = route.domain();
}
Source

pub fn route_is<H, T>(&self, handler: H) -> bool
where H: RouteHandler<T>,

Whether the matched route’s handler is the given handler, as in route_is(users::show). Returns false before routing. To match several routes, match their paths with resembles.

Source

pub fn route(&self, name: &str) -> Option<&str>

A domain or path parameter of the matched route, such as user in /users/{user}. Returns None when the parameter is absent or no route has matched.

let account = request.route("account");
let user = request.route("user");
Source

pub fn route_as<T>(&self, name: &str) -> Result<T, Error>

A domain or path parameter of the matched route, parsed into a type, as Params parses a handler’s parameters.

let team: i64 = request.route_as("team")?;
let month: Option<u8> = request.route_as("month")?;

Read an optional parameter as an Option, which is None when the parameter is absent.

§Errors

Fails with a 404 when the parameter doesn’t parse, such as /teams/laravel for an i64, because the URL names no such page. Fails with a 500 when no route has matched, or when the route has no such parameter and T isn’t an Option.

Source

pub async fn model<T>(&self, name: &str) -> Result<T, Error>
where T: RouteModel,

The record that a route parameter names, found with its RouteModel implementation:

let post: Post = request.model("post").await?;

The request finds each record once, so a later model call or Bound argument for the same parameter gets a copy without another lookup.

§Errors

Fails with a 404 when the parameter doesn’t parse as the key, or when no record has the key. Fails with a 500 when the route has no such parameter, and with the lookup’s error when the record can’t be looked up.

§Panics

Panics outside an application context, as laravel::once does.

Source

pub fn has_valid_signature(&self) -> bool

Whether the application signed the request’s URL, and the signature hasn’t expired.

Source§

impl Request

Source

pub fn session(&self) -> Result<&Session, Error>

The request’s session, available on routes in the web group:

use laravel::http::{Redirect, Request};

async fn store(request: Request) -> laravel::Result<Redirect> {
    request.session()?.flash("status", "Saved!");

    Ok(Redirect::back())
}
§Errors

Fails with a 500 when the request has no session. Only routes in the web group have a session, which StartSession starts. Global middleware run before the session starts, so they don’t see it either.

Source

pub fn old<T>(&self, path: &str) -> Option<T>

The input flashed for this request by a previous form submission, by dot-notation path. Reading the input doesn’t consume it. Returns None when the field was absent, its value isn’t a T, or this request has no session.

let name: Option<String> = request.old("name");
let tags = request.old::<Vec<String>>("tags").unwrap_or_default();
Source§

impl Request

Source

pub fn json<T>(&self) -> Result<T, Error>

Returns the JSON body deserialized into a type, whatever its shape: an object, a list such as a batch of items, or a single value. Request input holds only objects, so a handler reads a list or a single value with this method.

async fn import(request: laravel::http::Request) -> laravel::Result<String> {
    let items: Vec<Item> = request.json()?;
    Ok(format!("{} items", items.len()))
}
§Errors

Returns a 400 error when the body isn’t JSON or is a multipart form. Like parse, returns a 422 error that names the field when the body doesn’t fit the type. In middleware that hasn’t read the body with load_input, returns a 500 error.

Source

pub fn validate<T>( &self, ) -> impl Future<Output = Result<T, ValidationError>> + Send

Decodes and validates the request’s input with the rules declared on T.

First, T’s authorize runs. Then validation uses the rules that T’s rules returns. The error lists both rule errors and decoding errors, even when one field’s error prevents the type from being constructed.

§Errors

Returns ValidationError::Invalid when fields don’t pass. As a response, that error is a 422 for JSON and API requests. A browser request with a session gets a redirect back with the errors and old input, without passwords.

Returns ValidationError::Failed with a 403 when authorize returns false. It also returns Failed with the error of authorize, rules, or an async rule that couldn’t run. Match Invalid to render the form yourself, or propagate the error with ? for the standard responses.

#[derive(serde::Deserialize, laravel::validation::Validate)]
#[validate(anyone)]
struct StorePost {
    #[validate(bail, required, max_length = 255)]
    title: String,
}

let post: StorePost = request.validate().await?;
Source

pub fn validate_with<'a, T>( &'a self, rules: impl FnOnce(Rules) -> Rules + Send + 'a, ) -> impl Future<Output = Result<T, ValidationError>> + Send + 'a

Decodes and validates input with the rules declared on T, plus rules that the handler adds.

Use this when a rule needs a value that only the handler has, such as the ID of the record being updated. The closure receives T’s rules and returns the rules to validate with. Added rules run after the field’s declared rules.

§Errors

Returns the same errors as validate, with the same responses.

use laravel::validation::{DatabaseRules, Rule, Validate};

#[derive(serde::Deserialize, Validate)]
#[validate(anyone)]
struct UpdateTeam {
    #[validate(required, max_length = 255)]
    name: String,
}

let team: UpdateTeam = request
    .validate_with(|rules| {
        rules.field("name", [Rule::unique_in::<String>("teams", "name").ignore(team_id)])
    })
    .await?;
Source

pub fn parse<T>(&self) -> Result<T, Error>

Deserializes all of the request’s non-file input into a type.

Forms send every value as text, so numbers and booleans are parsed from the text. For example, age=42 reads as a u32, and a checked checkbox’s on reads as true.

Nested fields such as address[city] or items[0][sku] deserialize into nested structs and lists. A list holds its entries in index order, even when the form sends items[1] before items[0]. A null field counts as missing unless its type is an Option.

§Errors

Returns an InvalidInput error, a 422 Unprocessable Content, that names each field that doesn’t match the type. For example, a missing email field gets the message “The email field is required.” The error names at most 1,000 fields. For input of more than about a thousand values, it names only the first missing fields.

Source

pub async fn query<T>(&self) -> Result<T, Error>

Deserializes and validates the query string alone into a QueryInput type, ignoring the body, so a body field can’t stand in for a query parameter. Values are parsed from text as parse parses them, and input middleware such as TrimStrings and ConvertEmptyStringsToNull apply.

Mark the struct with #[laravel::query]. Fields with a fallback (Option<T>, #[default], #[default = expr], or #[serde(default)]) are lenient: missing, blank (?q=), or invalid (?page=abc) values fall back to None or their default. Fields without a fallback are required.

#[laravel::query]
struct Search {
    #[default]
    q: String,
    #[default = 1]
    page: u32,
}

let search: Search = request.query().await?;
§Errors

Returns a 400 Bad Request wrapping an InvalidInput when a required parameter (one without Option or a default) is missing, blank, or invalid, or when so many fields fail that validation stops early. API clients receive a 400 JSON response with the field errors, and browsers receive a 400 error page rather than a redirect. Any operational failure from an async validation rule (such as a database outage) is returned with its original error.

Trait Implementations§

Source§

impl Debug for Request

Shows the request without its credentials. It redacts the Cookie, Authorization, and Proxy-Authorization headers and every password field, and it shows the query string only as part of the input. The password fields are the ones named password, password_confirmation, or current_password, plus the Password fields of any input type that validated the request, along with their confirmations.

Source§

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

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

impl<S> FromRequest<S> for Request
where S: Send + Sync,

Source§

type Rejection = Error

If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response.
Source§

async fn from_request( request: Request<Body>, _state: &S, ) -> Result<Request, Error>

Perform the extraction.

Auto Trait Implementations§

§

impl !Freeze for Request

§

impl !RefUnwindSafe for Request

§

impl !UnwindSafe for Request

§

impl Forget for Request

§

impl Move for Request

§

impl Send for Request
where BoxRaw<[u8]>: Send, BoxRaw<ByteStr>: Send, Bytes: Send, BoxRaw<[Pos]>: Send, RawVecInner: Send, BoxRaw<HashMap<TypeId, Box<dyn AnyClone + Sync + Send>, BuildHasherDefault<IdHasher>>>: Send, BoxRaw<dyn Body<Error = Error, Data = Bytes> + Send>: Send, Arc<IndexMap<String, InputValue>>: Send, Mutex<Vec<Vec<String>>>: Send,

§

impl Sync for Request
where BoxRaw<[u8]>: Sync, BoxRaw<ByteStr>: Sync, Bytes: Sync, BoxRaw<[Pos]>: Sync, RawVecInner: Sync, BoxRaw<HashMap<TypeId, Box<dyn AnyClone + Sync + Send>, BuildHasherDefault<IdHasher>>>: Sync, SyncWrapper<Body>: Sync, Arc<IndexMap<String, InputValue>>: Sync, Mutex<Vec<Vec<String>>>: Sync,

§

impl Unpin for Request
where Box<[u8]>: Unpin, Box<ByteStr>: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Box<[Pos]>: Unpin, *const u8 is !null: Unpin, Box<HashMap<TypeId, Box<dyn AnyClone + Sync + Send>, BuildHasherDefault<IdHasher>>>: Unpin, Box<dyn Body<Error = Error, Data = Bytes> + Send>: Unpin, Arc<IndexMap<String, InputValue>>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin,

§

impl UnsafeUnpin for Request
where *const [u8] is !null: UnsafeUnpin, PhantomData<[u8]>: UnsafeUnpin, *const ByteStr is !null: UnsafeUnpin, PhantomData<ByteStr>: UnsafeUnpin, *const u8: UnsafeUnpin, Align8<*mut ()>: UnsafeUnpin, &'static Vtable: UnsafeUnpin, *const [Pos] is !null: UnsafeUnpin, PhantomData<[Pos]>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Bucket<HeaderValue>>: UnsafeUnpin, PhantomData<ExtraValue<HeaderValue>>: UnsafeUnpin, *const HashMap<TypeId, Box<dyn AnyClone + Sync + Send>, BuildHasherDefault<IdHasher>> is !null: UnsafeUnpin, PhantomData<HashMap<TypeId, Box<dyn AnyClone + Sync + Send>, BuildHasherDefault<IdHasher>>>: UnsafeUnpin, *const dyn Body<Error = Error, Data = Bytes> + Send is !null: UnsafeUnpin, PhantomData<dyn Body<Error = Error, Data = Bytes> + Send>: UnsafeUnpin, *const ArcInner<IndexMap<String, InputValue>> is !null: UnsafeUnpin, PhantomData<ArcInner<IndexMap<String, InputValue>>>: UnsafeUnpin, PhantomData<Vec<String>>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin,

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<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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: RngExt + ?Sized, Self: FakeBase<U>,

Source§

impl<T> FillValue<Option<T>> for T
where T: Send + 'static,

Source§

async fn fill(self) -> Result<Option<T>, Error>

Resolves the column’s value. Read more
Source§

impl<T> FillValue<T> for T
where T: Send + 'static,

Source§

async fn fill(self) -> Result<T, Error>

Resolves the column’s value. Read more
Source§

impl<K> ForeignKey<K> for K

Source§

fn key(&self) -> Option<&K>

Returns the key, or None when the field holds no key.
Source§

fn __from_key(key: K) -> K

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 with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. 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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T, N> NotifiedBy<T> for N
where T: Notification<N>,

Source§

fn __routes(&self) -> Vec<Route>

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<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<T, V> UpdateValue<T> for V
where V: FillValue<T>,

Source§

fn __update<M, U>(self, column: Column<M, T>, update: U) -> U
where M: Model, U: Updates<M>, T: IntoExpr + Clone + Send + Sync + 'static,

Source§

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

Source§

fn vzip(self) -> V

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