Skip to content

Commit

Permalink
Add references to Filter in documentation (#1062)
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Kölsch <t.koelsch@badgersystems.de>
  • Loading branch information
belgoking and Tobias Kölsch committed Aug 28, 2023
1 parent 2f2c744 commit 5ad8a9c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/filter/boxed.rs
Expand Up @@ -8,7 +8,7 @@ use futures_util::TryFutureExt;
use super::{Filter, FilterBase, Internal, Tuple};
use crate::reject::Rejection;

/// A type representing a boxed `Filter` trait object.
/// A type representing a boxed [`Filter`](crate::Filter) trait object.
///
/// The filter inside is a dynamic trait object. The purpose of this type is
/// to ease returning `Filter`s from other functions.
Expand Down
2 changes: 1 addition & 1 deletion src/filters/any.rs
Expand Up @@ -6,7 +6,7 @@ use std::task::{Context, Poll};

use crate::filter::{Filter, FilterBase, Internal};

/// A filter that matches any route.
/// A [`Filter`](crate::Filter) that matches any route.
///
/// This can be a useful building block to build new filters from,
/// since [`Filter`] is otherwise a sealed trait.
Expand Down
4 changes: 2 additions & 2 deletions src/filters/cors.rs
Expand Up @@ -20,7 +20,7 @@ use crate::reply::Reply;

use self::internal::{CorsFilter, IntoOrigin, Seconds};

/// Create a wrapping filter that exposes [CORS][] behavior for a wrapped
/// Create a wrapping [`Filter`](crate::Filter) that exposes [CORS][] behavior for a wrapped
/// filter.
///
/// [CORS]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
Expand Down Expand Up @@ -56,7 +56,7 @@ pub fn cors() -> Builder {
}
}

/// A wrapping filter constructed via `warp::cors()`.
/// A wrapping [`Filter`](crate::Filter) constructed via `warp::cors()`.
#[derive(Clone, Debug)]
pub struct Cors {
config: Arc<Configured>,
Expand Down
4 changes: 2 additions & 2 deletions src/filters/log.rs
Expand Up @@ -13,7 +13,7 @@ use crate::route::Route;

use self::internal::WithLog;

/// Create a wrapping filter with the specified `name` as the `target`.
/// Create a wrapping [`Filter`](crate::Filter) with the specified `name` as the `target`.
///
/// This uses the default access logging format, and log records produced
/// will have their `target` set to `name`.
Expand Down Expand Up @@ -50,7 +50,7 @@ pub fn log(name: &'static str) -> Log<impl Fn(Info<'_>) + Copy> {
Log { func }
}

/// Create a wrapping filter that receives `warp::log::Info`.
/// Create a wrapping [`Filter`](crate::Filter) that receives `warp::log::Info`.
///
/// # Example
///
Expand Down
6 changes: 3 additions & 3 deletions src/filters/multipart.rs
@@ -1,6 +1,6 @@
//! Multipart body filters
//!
//! Filters that extract a multipart body for a route.
//! [`Filter`](crate::Filter)s that extract a multipart body for a route.

use std::error::Error as StdError;
use std::fmt::{Display, Formatter};
Expand All @@ -22,7 +22,7 @@ use crate::reject::{self, Rejection};
// If not otherwise configured, default to 2MB.
const DEFAULT_FORM_DATA_MAX_LENGTH: u64 = 1024 * 1024 * 2;

/// A `Filter` to extract a `multipart/form-data` body from a request.
/// A [`Filter`](crate::Filter) to extract a `multipart/form-data` body from a request.
///
/// Create with the `warp::multipart::form()` function.
#[derive(Debug, Clone)]
Expand All @@ -44,7 +44,7 @@ pub struct Part {
part: PartInner<'static>,
}

/// Create a `Filter` to extract a `multipart/form-data` body from a request.
/// Create a [`Filter`](crate::Filter) to extract a `multipart/form-data` body from a request.
///
/// The extracted `FormData` type is a `Stream` of `Part`s, and each `Part`
/// in turn is a `Stream` of bytes.
Expand Down
6 changes: 3 additions & 3 deletions src/filters/path.rs
@@ -1,6 +1,6 @@
//! Path Filters
//!
//! The filters here work on the "path" of requests.
//! The [`Filter`](crate::Filter)s here work on the "path" of requests.
//!
//! - [`path`](./fn.path.html) matches a specific segment, like `/foo`.
//! - [`param`](./fn.param.html) tries to parse a segment into a type, like `/:u16`.
Expand Down Expand Up @@ -137,7 +137,7 @@ use crate::filter::{filter_fn, one, Filter, FilterBase, Internal, One, Tuple};
use crate::reject::{self, Rejection};
use crate::route::{self, Route};

/// Create an exact match path segment `Filter`.
/// Create an exact match path segment [`Filter`](crate::Filter).
///
/// This will try to match exactly to the current request path segment.
///
Expand Down Expand Up @@ -189,7 +189,7 @@ where
*/
}

/// A `Filter` matching an exact path segment.
/// A [`Filter`](crate::Filter) matching an exact path segment.
///
/// Constructed from `path()` or `path!()`.
#[allow(missing_debug_implementations)]
Expand Down

0 comments on commit 5ad8a9c

Please sign in to comment.