Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Mut and Once #1296

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions axum-core/src/extract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ pub use self::from_ref::FromRef;

mod private {
#[derive(Debug, Clone, Copy)]
pub enum Mut {}
pub enum ViaParts {}

#[derive(Debug, Clone, Copy)]
pub enum Once {}
pub enum ViaRequest {}
}

/// Types that can be created from request parts.
Expand Down Expand Up @@ -100,7 +100,7 @@ pub trait FromRequestParts<S>: Sized {
/// [`http::Request<B>`]: http::Request
/// [`axum::extract`]: https://docs.rs/axum/0.6/axum/extract/index.html
#[async_trait]
pub trait FromRequest<S, B, M = private::Once>: Sized {
pub trait FromRequest<S, B, M = private::ViaRequest>: Sized {
/// If the extractor fails it'll use this "rejection" type. A rejection is
/// a kind of error that can be converted into a response.
type Rejection: IntoResponse;
Expand All @@ -110,7 +110,7 @@ pub trait FromRequest<S, B, M = private::Once>: Sized {
}

#[async_trait]
impl<S, B, T> FromRequest<S, B, private::Mut> for T
impl<S, B, T> FromRequest<S, B, private::ViaParts> for T
where
B: Send + 'static,
S: Send + Sync,
Expand Down