repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web-actors/tests/test_ws.rs | actix-web-actors/tests/test_ws.rs | use actix::prelude::*;
use actix_http::ws::Codec;
use actix_web::{web, App, HttpRequest};
use actix_web_actors::ws;
use bytes::Bytes;
use futures_util::{SinkExt as _, StreamExt as _};
struct Ws;
impl Actor for Ws {
type Context = ws::WebsocketContext<Self>;
}
impl StreamHandler<Result<ws::Message, ws::ProtocolEr... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/test.rs | awc/src/test.rs | //! Test helpers for actix http client to use during testing.
use actix_http::{h1, header::TryIntoHeaderPair, Payload, ResponseHead, StatusCode, Version};
use bytes::Bytes;
#[cfg(feature = "cookies")]
use crate::cookie::{Cookie, CookieJar};
use crate::ClientResponse;
/// Test `ClientResponse` builder
pub struct Test... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/sender.rs | awc/src/sender.rs | use std::{
future::Future,
net,
pin::Pin,
rc::Rc,
task::{Context, Poll},
time::Duration,
};
use actix_http::{
body::{BodyStream, MessageBody},
error::HttpError,
header::{self, HeaderMap, HeaderName, TryIntoHeaderValue},
RequestHead, RequestHeadType,
};
#[cfg(feature = "__compres... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/frozen.rs | awc/src/frozen.rs | use std::{net, rc::Rc, time::Duration};
use actix_http::{
body::MessageBody,
error::HttpError,
header::{HeaderMap, TryIntoHeaderPair},
Method, RequestHead, Uri,
};
use bytes::Bytes;
use futures_core::Stream;
use serde::Serialize;
use crate::{
client::ClientConfig,
sender::{RequestSender, SendC... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/builder.rs | awc/src/builder.rs | use std::{fmt, net::IpAddr, rc::Rc, time::Duration};
use actix_http::{
error::HttpError,
header::{self, HeaderMap, HeaderName, TryIntoHeaderPair},
Uri,
};
use actix_rt::net::{ActixStream, TcpStream};
use actix_service::{boxed, Service};
use base64::prelude::*;
use crate::{
client::{
ClientConf... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/lib.rs | awc/src/lib.rs | //! `awc` is an asynchronous HTTP and WebSocket client library.
//!
//! # `GET` Requests
//! ```no_run
//! # #[actix_rt::main]
//! # async fn main() -> Result<(), awc::error::SendRequestError> {
//! // create client
//! let mut client = awc::Client::default();
//!
//! // construct request
//! let req = client.get("http... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/connect.rs | awc/src/connect.rs | use std::{
future::Future,
net,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_codec::Framed;
use actix_http::{h1::ClientCodec, Payload, RequestHead, RequestHeadType, ResponseHead};
use actix_service::Service;
use futures_core::{future::LocalBoxFuture, ready};
use crate::{
any_body::Any... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/error.rs | awc/src/error.rs | //! HTTP client errors
// TODO: figure out how best to expose http::Error vs actix_http::Error
pub use actix_http::{
error::{HttpError, PayloadError},
header::HeaderValue,
ws::{HandshakeError as WsHandshakeError, ProtocolError as WsProtocolError},
StatusCode,
};
use derive_more::{Display, From};
use se... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/any_body.rs | awc/src/any_body.rs | use std::{
fmt, mem,
pin::Pin,
task::{Context, Poll},
};
use actix_http::body::{BodySize, BoxBody, MessageBody};
use bytes::Bytes;
use pin_project_lite::pin_project;
pin_project! {
/// Represents various types of HTTP message body.
#[derive(Clone)]
#[project = AnyBodyProj]
pub enum AnyBody... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/ws.rs | awc/src/ws.rs | //! Websockets client
//!
//! Type definitions required to use [`awc::Client`](super::Client) as a WebSocket client.
//!
//! # Examples
//!
//! ```no_run
//! use awc::{Client, ws};
//! use futures_util::{SinkExt as _, StreamExt as _};
//!
//! #[actix_rt::main]
//! async fn main() {
//! let (_resp, mut connection) =... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/request.rs | awc/src/request.rs | use std::{fmt, net, rc::Rc, time::Duration};
use actix_http::{
body::MessageBody,
error::HttpError,
header::{self, HeaderMap, HeaderValue, TryIntoHeaderPair},
ConnectionType, Method, RequestHead, Uri, Version,
};
use base64::prelude::*;
use bytes::Bytes;
use futures_core::Stream;
use serde::Serialize;
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/middleware/redirect.rs | awc/src/middleware/redirect.rs | use std::{
future::Future,
net::SocketAddr,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_http::{header, Method, RequestHead, RequestHeadType, StatusCode, Uri};
use actix_service::Service;
use bytes::Bytes;
use futures_core::ready;
use super::Transform;
use crate::{
any_body::AnyBody,
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/middleware/mod.rs | awc/src/middleware/mod.rs | mod redirect;
use std::marker::PhantomData;
use actix_service::Service;
pub use self::redirect::Redirect;
/// Trait for transform a type to another one.
/// Both the input and output type should impl [actix_service::Service] trait.
pub trait Transform<S, Req> {
type Transform: Service<Req>;
/// Creates and... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/config.rs | awc/src/client/config.rs | use std::{net::IpAddr, time::Duration};
const DEFAULT_H2_CONN_WINDOW: u32 = 1024 * 1024 * 2; // 2MB
const DEFAULT_H2_STREAM_WINDOW: u32 = 1024 * 1024; // 1MB
/// Connector configuration
#[derive(Clone)]
pub(crate) struct ConnectorConfig {
pub(crate) timeout: Duration,
pub(crate) handshake_timeout: Duration,
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/h2proto.rs | awc/src/client/h2proto.rs | use std::future::Future;
use actix_http::{
body::{BodySize, MessageBody},
header::HeaderMap,
Payload, RequestHeadType, ResponseHead,
};
use actix_utils::future::poll_fn;
use bytes::Bytes;
use h2::{
client::{Builder, Connection, SendRequest},
SendStream,
};
use http::{
header::{HeaderValue, CONN... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/connector.rs | awc/src/client/connector.rs | use std::{
fmt,
future::Future,
net::IpAddr,
pin::Pin,
rc::Rc,
task::{Context, Poll},
time::Duration,
};
use actix_http::Protocol;
use actix_rt::{
net::{ActixStream, TcpStream},
time::{sleep, Sleep},
};
use actix_service::Service;
use actix_tls::connect::{
ConnectError as TcpCon... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/connection.rs | awc/src/client/connection.rs | use std::{
io,
ops::{Deref, DerefMut},
pin::Pin,
task::{Context, Poll},
time,
};
use actix_codec::{AsyncRead, AsyncWrite, Framed, ReadBuf};
use actix_http::{body::MessageBody, h1::ClientCodec, Payload, RequestHeadType, ResponseHead};
use actix_rt::task::JoinHandle;
use bytes::Bytes;
use futures_cor... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/error.rs | awc/src/client/error.rs | use std::{fmt, io};
use actix_http::error::{HttpError, ParseError};
#[cfg(feature = "openssl")]
use actix_tls::accept::openssl::reexports::Error as OpensslError;
use derive_more::{Display, From};
use crate::BoxError;
/// A set of errors that can occur while connecting to an HTTP host
#[derive(Debug, Display, From)]
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/mod.rs | awc/src/client/mod.rs | //! HTTP client.
use std::{rc::Rc, time::Duration};
use actix_http::{error::HttpError, header::HeaderMap, Method, RequestHead, Uri};
use actix_rt::net::TcpStream;
use actix_service::Service;
pub use actix_tls::connect::{
ConnectError as TcpConnectError, ConnectInfo, Connection as TcpConnection,
};
use crate::{ws... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/pool.rs | awc/src/client/pool.rs | //! Client connection pooling keyed on the authority part of the connection URI.
use std::{
cell::RefCell,
collections::{HashMap, VecDeque},
future::Future,
io,
ops::Deref,
pin::Pin,
rc::Rc,
sync::Arc,
task::{Context, Poll},
time::{Duration, Instant},
};
use actix_codec::{Async... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/client/h1proto.rs | awc/src/client/h1proto.rs | use std::{
io::Write,
pin::Pin,
task::{Context, Poll},
};
use actix_codec::Framed;
use actix_http::{
body::{BodySize, MessageBody},
error::PayloadError,
h1,
header::{HeaderMap, TryIntoHeaderValue, EXPECT, HOST},
Payload, RequestHeadType, ResponseHead, StatusCode,
};
use actix_utils::fut... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/responses/response_body.rs | awc/src/responses/response_body.rs | use std::{
future::Future,
mem,
pin::Pin,
task::{Context, Poll},
};
use actix_http::{error::PayloadError, header, HttpMessage};
use bytes::Bytes;
use futures_core::Stream;
use pin_project_lite::pin_project;
use super::{read_body::ReadBody, ResponseTimeout, DEFAULT_BODY_LIMIT};
use crate::ClientRespons... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/responses/response.rs | awc/src/responses/response.rs | use std::{
cell::{Ref, RefCell, RefMut},
fmt, mem,
pin::Pin,
task::{Context, Poll},
time::{Duration, Instant},
};
use actix_http::{
error::PayloadError, header::HeaderMap, BoxedPayloadStream, Extensions, HttpMessage, Payload,
ResponseHead, StatusCode, Version,
};
use actix_rt::time::{sleep,... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/responses/json_body.rs | awc/src/responses/json_body.rs | use std::{
future::Future,
marker::PhantomData,
mem,
pin::Pin,
task::{Context, Poll},
};
use actix_http::{error::PayloadError, header, HttpMessage};
use bytes::Bytes;
use futures_core::{ready, Stream};
use pin_project_lite::pin_project;
use serde::de::DeserializeOwned;
use super::{read_body::ReadB... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/responses/mod.rs | awc/src/responses/mod.rs | use std::{future::Future, io, pin::Pin, task::Context};
use actix_http::error::PayloadError;
use actix_rt::time::Sleep;
mod json_body;
mod read_body;
mod response;
mod response_body;
#[allow(deprecated)]
pub use self::response_body::{MessageBody, ResponseBody};
pub use self::{json_body::JsonBody, response::ClientRes... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/src/responses/read_body.rs | awc/src/responses/read_body.rs | use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
use actix_http::{error::PayloadError, Payload};
use bytes::{Bytes, BytesMut};
use futures_core::{ready, Stream};
use pin_project_lite::pin_project;
pin_project! {
pub(crate) struct ReadBody<S> {
#[pin]
pub(crate) stream: Pa... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/tests/test_ssl_client.rs | awc/tests/test_ssl_client.rs | #![cfg(feature = "openssl")]
extern crate tls_openssl as openssl;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use actix_http::HttpService;
use actix_http_test::test_server;
use actix_service::{fn_service, map_config, ServiceFactoryExt};
use actix_utils::future::ok;
use actix_web::{dev::AppConfi... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/tests/test_rustls_client.rs | awc/tests/test_rustls_client.rs | #![cfg(feature = "rustls-0_23-webpki-roots")]
extern crate tls_rustls_0_23 as rustls;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use actix_http::HttpService;
use actix_http_test::test_server;
use actix_service::{fn_service, map_config, ServiceFactoryExt};
use actix_tls::connect::rustls_0_23::w... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/tests/test_client.rs | awc/tests/test_client.rs | use std::{
collections::HashMap,
convert::Infallible,
io::{Read, Write},
net::{IpAddr, Ipv4Addr},
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
time::Duration,
};
use actix_http::{HttpService, StatusCode};
use actix_http_test::test_server;
use actix_service::{fn_service, ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/tests/test_ws.rs | awc/tests/test_ws.rs | use std::io;
use actix_codec::Framed;
use actix_http::{body::BodySize, h1, ws, Error, HttpService, Request, Response};
use actix_http_test::test_server;
use actix_utils::future::ok;
use bytes::Bytes;
use futures_util::{SinkExt as _, StreamExt as _};
async fn ws_service(req: ws::Frame) -> Result<ws::Message, io::Error... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/tests/test_connector.rs | awc/tests/test_connector.rs | #![cfg(feature = "openssl")]
extern crate tls_openssl as openssl;
use actix_http::HttpService;
use actix_http_test::test_server;
use actix_service::{map_config, ServiceFactoryExt};
use actix_web::{dev::AppConfig, http::Version, web, App, HttpResponse};
use openssl::{
pkey::PKey,
ssl::{SslAcceptor, SslConnecto... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/tests/utils.rs | awc/tests/utils.rs | // compiling some tests will trigger unused function warnings even though other tests use them
#![allow(dead_code)]
use std::io::{Read as _, Write as _};
pub mod gzip {
use flate2::{read::GzDecoder, write::GzEncoder, Compression};
use super::*;
pub fn encode(bytes: impl AsRef<[u8]>) -> Vec<u8> {
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/awc/examples/client.rs | awc/examples/client.rs | //! Demonstrates construction and usage of a TLS-capable HTTP client.
extern crate tls_rustls_0_23 as rustls;
use std::{error::Error as StdError, sync::Arc};
use actix_tls::connect::rustls_0_23::webpki_roots_cert_store;
use rustls::ClientConfig;
#[actix_rt::main]
async fn main() -> Result<(), Box<dyn StdError>> {
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/resource.rs | actix-router/src/resource.rs | use std::{
borrow::{Borrow, Cow},
collections::HashMap,
hash::{BuildHasher, Hash, Hasher},
mem,
};
use tracing::error;
use crate::{
path::PathItem,
regex_set::{escape, Regex, RegexSet},
IntoPatterns, Patterns, Resource, ResourcePath,
};
const MAX_DYNAMIC_SEGMENTS: usize = 16;
/// Regex f... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/path.rs | actix-router/src/path.rs | use std::{
borrow::Cow,
ops::{DerefMut, Index},
};
use serde::{de, Deserialize};
use crate::{de::PathDeserializer, Resource, ResourcePath};
#[derive(Debug, Clone)]
pub(crate) enum PathItem {
Static(Cow<'static, str>),
Segment(u16, u16),
}
impl Default for PathItem {
fn default() -> Self {
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/router.rs | actix-router/src/router.rs | use crate::{IntoPatterns, Resource, ResourceDef};
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct ResourceId(pub u16);
/// Resource router.
///
/// It matches a [routing resource](Resource) to an ordered list of _routes_. Each is defined by a
/// single [`ResourceDef`] and contains two types of custom data:
/... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/lib.rs | actix-router/src/lib.rs | //! Resource path matching and router.
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_cfg))]
mod de;
mod path;
mod pattern;
mod quoter;
mod regex_set;
mod resource;
mod resource_path;
mod router;
#[cfg(feature = "htt... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/pattern.rs | actix-router/src/pattern.rs | /// One or many patterns.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Patterns {
Single(String),
List(Vec<String>),
}
impl Patterns {
pub fn is_empty(&self) -> bool {
match self {
Patterns::Single(_) => false,
Patterns::List(pats) => pats.is_empty(),
}
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/resource_path.rs | actix-router/src/resource_path.rs | use crate::Path;
// TODO: this trait is necessary, document it
// see impl Resource for ServiceRequest
pub trait Resource {
/// Type of resource's path returned in `resource_path`.
type Path: ResourcePath;
fn resource_path(&mut self) -> &mut Path<Self::Path>;
}
pub trait ResourcePath {
fn path(&self)... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/url.rs | actix-router/src/url.rs | use crate::{Quoter, ResourcePath};
thread_local! {
static DEFAULT_QUOTER: Quoter = Quoter::new(b"", b"%/+");
}
#[derive(Debug, Clone, Default)]
pub struct Url {
uri: http::Uri,
path: Option<String>,
}
impl Url {
#[inline]
pub fn new(uri: http::Uri) -> Url {
let path = DEFAULT_QUOTER.with(... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/regex_set.rs | actix-router/src/regex_set.rs | //! Abstraction over `regex` and `regex-lite` depending on whether we have `unicode` crate feature
//! enabled.
use cfg_if::cfg_if;
#[cfg(feature = "unicode")]
pub(crate) use regex::{escape, Regex};
#[cfg(not(feature = "unicode"))]
pub(crate) use regex_lite::{escape, Regex};
#[cfg(feature = "unicode")]
#[derive(Debug... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/quoter.rs | actix-router/src/quoter.rs | /// Partial percent-decoding.
///
/// Performs percent-decoding on a slice but can selectively skip decoding certain sequences.
///
/// # Examples
/// ```
/// # use actix_router::Quoter;
/// // + is set as a protected character and will not be decoded...
/// let q = Quoter::new(&[], b"+");
///
/// // ...but the other e... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/src/de.rs | actix-router/src/de.rs | use std::borrow::Cow;
use serde::{
de::{self, Deserializer, Error as DeError, Visitor},
forward_to_deserialize_any,
};
use crate::{
path::{Path, PathIter},
Quoter, ResourcePath,
};
thread_local! {
static FULL_QUOTER: Quoter = Quoter::new(b"", b"");
}
macro_rules! unsupported_type {
($trait_f... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/benches/router.rs | actix-router/benches/router.rs | //! Based on https://github.com/ibraheemdev/matchit/blob/master/benches/bench.rs
use criterion::{black_box, criterion_group, criterion_main, Criterion};
macro_rules! register {
(colon) => {{
register!(finish => ":p1", ":p2", ":p3", ":p4")
}};
(brackets) => {{
register!(finish => "{p1}", "{... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-router/benches/quoter.rs | actix-router/benches/quoter.rs | use std::{borrow::Cow, fmt::Write as _};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
fn compare_quoters(c: &mut Criterion) {
let mut group = c.benchmark_group("Compare Quoters");
let quoter = actix_router::Quoter::new(b"", b"");
let path_quoted = (0..=0x7f).fold(String::new(),... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/config.rs | actix-web/src/config.rs | use std::{net::SocketAddr, rc::Rc};
use actix_service::{boxed, IntoServiceFactory, ServiceFactory, ServiceFactoryExt as _};
use crate::{
data::Data,
dev::{Extensions, ResourceDef},
error::Error,
guard::Guard,
resource::Resource,
rmap::ResourceMap,
route::Route,
service::{
AppSe... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/app.rs | actix-web/src/app.rs | use std::{cell::RefCell, fmt, future::Future, rc::Rc};
use actix_http::{body::MessageBody, Extensions, Request};
use actix_service::{
apply, apply_fn_factory, boxed, IntoServiceFactory, ServiceFactory, ServiceFactoryExt,
Transform,
};
use futures_util::FutureExt as _;
use crate::{
app_service::{AppEntry, ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/dev.rs | actix-web/src/dev.rs | //! Lower-level types and re-exports.
//!
//! Most users will not have to interact with the types in this module, but it is useful for those
//! writing extractors, middleware, libraries, or interacting with the service API directly.
//!
//! # Request Extractors
//! - [`ConnectionInfo`]: Connection information
//! - [`... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/resource.rs | actix-web/src/resource.rs | use std::{cell::RefCell, fmt, future::Future, rc::Rc};
use actix_http::Extensions;
use actix_router::{IntoPatterns, Patterns};
use actix_service::{
apply, apply_fn_factory, boxed, fn_service, IntoServiceFactory, Service, ServiceFactory,
ServiceFactoryExt, Transform,
};
use futures_core::future::LocalBoxFuture;... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/request_data.rs | actix-web/src/request_data.rs | use std::{any::type_name, ops::Deref};
use actix_utils::future::{err, ok, Ready};
use crate::{
dev::Payload, error::ErrorInternalServerError, Error, FromRequest, HttpMessage as _,
HttpRequest,
};
/// Request-local data extractor.
///
/// Request-local data is arbitrary data attached to an individual request,... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/lib.rs | actix-web/src/lib.rs | //! Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.
//!
//! # Examples
//! ```no_run
//! use actix_web::{get, web, App, HttpServer, Responder};
//!
//! #[get("/hello/{name}")]
//! async fn greet(name: web::Path<String>) -> impl Responder {
//! format!("Hello {}!", name)
//! }
//!
//! ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/thin_data.rs | actix-web/src/thin_data.rs | use std::any::type_name;
use actix_utils::future::{ready, Ready};
use crate::{dev::Payload, error, FromRequest, HttpRequest};
/// Application data wrapper and extractor for cheaply-cloned types.
///
/// Similar to the [`Data`] wrapper but for `Clone`/`Copy` types that are already an `Arc` internally,
/// share state... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/helpers.rs | actix-web/src/helpers.rs | use std::io;
use bytes::BufMut;
/// An `io::Write`r that only requires mutable reference and assumes that there is space available
/// in the buffer for every write operation or that it can be extended implicitly (like
/// `bytes::BytesMut`, for example).
///
/// This is slightly faster (~10%) than `bytes::buf::Write... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/redirect.rs | actix-web/src/redirect.rs | //! See [`Redirect`] for service/responder documentation.
use std::borrow::Cow;
use actix_utils::future::ready;
use crate::{
dev::{fn_service, AppService, HttpServiceFactory, ResourceDef, ServiceRequest},
http::{header::LOCATION, StatusCode},
HttpRequest, HttpResponse, Responder,
};
/// An HTTP service ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/info.rs | actix-web/src/info.rs | use std::{convert::Infallible, net::SocketAddr};
use actix_utils::future::{err, ok, Ready};
use derive_more::{Display, Error};
use crate::{
dev::{AppConfig, Payload, RequestHead},
http::{
header::{self, HeaderName},
uri::{Authority, Scheme},
},
FromRequest, HttpRequest, ResponseError,
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/rt.rs | actix-web/src/rt.rs | //! A selection of re-exports from [`tokio`] and [`actix-rt`].
//!
//! Actix Web runs on [Tokio], providing full[^compat] compatibility with its huge ecosystem of
//! crates. Each of the server's workers uses a single-threaded runtime. Read more about the
//! architecture in [`actix-rt`]'s docs.
//!
//! # Running Actix... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/service.rs | actix-web/src/service.rs | use std::{
cell::{Ref, RefMut},
fmt, net,
rc::Rc,
};
use actix_http::{
body::{BoxBody, EitherBody, MessageBody},
header::HeaderMap,
BoxedPayloadStream, Extensions, HttpMessage, Method, Payload, RequestHead, Response,
ResponseHead, StatusCode, Uri, Version,
};
use actix_router::{IntoPatterns... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/scope.rs | actix-web/src/scope.rs | use std::{cell::RefCell, fmt, future::Future, mem, rc::Rc};
use actix_http::{body::MessageBody, Extensions};
use actix_router::{ResourceDef, Router};
use actix_service::{
apply, apply_fn_factory, boxed, IntoServiceFactory, Service, ServiceFactory, ServiceFactoryExt,
Transform,
};
use futures_core::future::Loca... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/app_service.rs | actix-web/src/app_service.rs | use std::{cell::RefCell, mem, rc::Rc};
use actix_http::Request;
use actix_router::{Path, ResourceDef, Router, Url};
use actix_service::{boxed, fn_service, Service, ServiceFactory};
use futures_core::future::LocalBoxFuture;
use futures_util::future::join_all;
use crate::{
body::BoxBody,
config::{AppConfig, App... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/rmap.rs | actix-web/src/rmap.rs | use std::{
borrow::Cow,
cell::RefCell,
fmt::Write as _,
rc::{Rc, Weak},
};
use actix_router::ResourceDef;
use foldhash::HashMap as FoldHashMap;
use url::Url;
use crate::{error::UrlGenerationError, request::HttpRequest};
const AVG_PATH_LEN: usize = 24;
#[derive(Clone, Debug)]
pub struct ResourceMap {... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/web.rs | actix-web/src/web.rs | //! Essentials helper functions and types for application registration.
//!
//! # Request Extractors
//! - [`Data`]: Application data item
//! - [`ThinData`]: Cheap-to-clone application data item
//! - [`ReqData`]: Request-local data item
//! - [`Path`]: URL path parameters / dynamic segments
//! - [`Query`]: URL query... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/server.rs | actix-web/src/server.rs | use std::{
any::Any,
cmp, fmt,
future::Future,
io,
marker::PhantomData,
net,
sync::{Arc, Mutex},
time::Duration,
};
#[cfg(feature = "__tls")]
use actix_http::TlsAcceptorConfig;
use actix_http::{body::MessageBody, Extensions, HttpService, KeepAlive, Request, Response};
use actix_server::... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/extract.rs | actix-web/src/extract.rs | //! Request extractors
use std::{
convert::Infallible,
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
};
use actix_http::{Method, Uri};
use actix_utils::future::{ok, Ready};
use futures_core::ready;
use pin_project_lite::pin_project;
use crate::{dev::Payload, Error, HttpReq... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/request.rs | actix-web/src/request.rs | use std::{
cell::{Ref, RefCell, RefMut},
fmt, net,
rc::Rc,
str,
};
use actix_http::{Message, RequestHead};
use actix_router::{Path, Url};
use actix_utils::future::{ok, Ready};
#[cfg(feature = "cookies")]
use cookie::{Cookie, ParseError as CookieParseError};
use smallvec::SmallVec;
use crate::{
app... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/route.rs | actix-web/src/route.rs | use std::{mem, rc::Rc};
use actix_http::{body::MessageBody, Method};
use actix_service::{
apply,
boxed::{self, BoxService},
fn_service, Service, ServiceFactory, ServiceFactoryExt, Transform,
};
use futures_core::future::LocalBoxFuture;
use crate::{
guard::{self, Guard},
handler::{handler_service, ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/data.rs | actix-web/src/data.rs | use std::{any::type_name, ops::Deref, sync::Arc};
use actix_http::Extensions;
use actix_utils::future::{err, ok, Ready};
use futures_core::future::LocalBoxFuture;
use serde::{de, Serialize};
use crate::{dev::Payload, error, Error, FromRequest, HttpRequest};
/// Data factory.
pub(crate) trait DataFactory {
/// Re... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/handler.rs | actix-web/src/handler.rs | use std::future::Future;
use actix_service::{boxed, fn_service};
use crate::{
service::{BoxedHttpServiceFactory, ServiceRequest, ServiceResponse},
FromRequest, HttpResponse, Responder,
};
/// The interface for request handlers.
///
/// # What Is A Request Handler
///
/// In short, a handler is just an async ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/error/internal.rs | actix-web/src/error/internal.rs | use std::{cell::RefCell, fmt, io::Write as _};
use actix_http::{
body::BoxBody,
header::{self, TryIntoHeaderValue as _},
StatusCode,
};
use bytes::{BufMut as _, BytesMut};
use crate::{Error, HttpRequest, HttpResponse, Responder, ResponseError};
/// Wraps errors to alter the generated response status code... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/error/response_error.rs | actix-web/src/error/response_error.rs | //! `ResponseError` trait and foreign impls.
use std::{
convert::Infallible,
error::Error as StdError,
fmt,
io::{self, Write as _},
};
use bytes::BytesMut;
use crate::{
body::BoxBody,
error::{downcast_dyn, downcast_get_type_id},
helpers,
http::{
header::{self, TryIntoHeaderVal... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/error/error.rs | actix-web/src/error/error.rs | use std::{error::Error as StdError, fmt};
use actix_http::{body::BoxBody, Response};
use crate::{HttpResponse, ResponseError};
/// General purpose Actix Web error.
///
/// An Actix Web error is used to carry errors from `std::error` through actix in a convenient way.
/// It can be created through converting errors w... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/error/macros.rs | actix-web/src/error/macros.rs | macro_rules! downcast_get_type_id {
() => {
/// A helper method to get the type ID of the type
/// this trait is implemented on.
/// This method is unsafe to *implement*, since `downcast_ref` relies
/// on the returned `TypeId` to perform a cast.
///
/// Unfortunately... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/error/mod.rs | actix-web/src/error/mod.rs | //! Error and Result module
// This is meant to be a glob import of the whole error module except for `Error`. Rustdoc can't yet
// correctly resolve the conflicting `Error` type defined in this module, so these re-exports are
// expanded manually.
//
// See <https://github.com/rust-lang/rust/issues/83375>
pub use act... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/err_handlers.rs | actix-web/src/middleware/err_handlers.rs | //! For middleware documentation, see [`ErrorHandlers`].
use std::{
future::Future,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_service::{Service, Transform};
use foldhash::HashMap as FoldHashMap;
use futures_core::{future::LocalBoxFuture, ready};
use pin_project_lite::pin_project;
use crat... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/compress.rs | actix-web/src/middleware/compress.rs | //! For middleware documentation, see [`Compress`].
use std::{
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
};
use actix_http::encoding::Encoder;
use actix_service::{Service, Transform};
use actix_utils::future::{ok, Either, Ready};
use futures_core::ready;
use mime::Mime;
use... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/logger.rs | actix-web/src/middleware/logger.rs | //! For middleware documentation, see [`Logger`].
use std::{
borrow::Cow,
collections::HashSet,
env,
fmt::{self, Display as _},
future::Future,
marker::PhantomData,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_service::{Service, Transform};
use actix_utils::future::{ready,... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | true |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/from_fn.rs | actix-web/src/middleware/from_fn.rs | use std::{future::Future, marker::PhantomData, rc::Rc};
use actix_service::boxed::{self, BoxFuture, RcService};
use actix_utils::future::{ready, Ready};
use futures_core::future::LocalBoxFuture;
use crate::{
body::MessageBody,
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
Erro... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/mod.rs | actix-web/src/middleware/mod.rs | //! A collection of common middleware.
//!
//! # What Is Middleware?
//!
//! Actix Web's middleware system allows us to add additional behavior to request/response
//! processing. Middleware can hook into incoming request and outgoing response processes, enabling
//! us to modify requests and responses as well as halt ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/condition.rs | actix-web/src/middleware/condition.rs | //! For middleware documentation, see [`Condition`].
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
use futures_core::{future::LocalBoxFuture, ready};
use futures_util::FutureExt as _;
use pin_project_lite::pin_project;
use crate::{
body::EitherBody,
dev::{Service, ServiceResponse... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/normalize.rs | actix-web/src/middleware/normalize.rs | //! For middleware documentation, see [`NormalizePath`].
use actix_http::uri::{PathAndQuery, Uri};
use actix_service::{Service, Transform};
use actix_utils::future::{ready, Ready};
use bytes::Bytes;
#[cfg(feature = "unicode")]
use regex::Regex;
#[cfg(not(feature = "unicode"))]
use regex_lite::Regex;
use crate::{
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/identity.rs | actix-web/src/middleware/identity.rs | //! A no-op middleware. See [Noop] for docs.
use actix_utils::future::{ready, Ready};
use crate::dev::{forward_ready, Service, Transform};
/// A no-op middleware that passes through request and response untouched.
#[derive(Debug, Clone, Default)]
#[non_exhaustive]
pub struct Identity;
impl<S: Service<Req>, Req> Tra... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/default_headers.rs | actix-web/src/middleware/default_headers.rs | //! For middleware documentation, see [`DefaultHeaders`].
use std::{
future::Future,
marker::PhantomData,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_http::error::HttpError;
use actix_utils::future::{ready, Ready};
use futures_core::ready;
use pin_project_lite::pin_project;
use crate::{... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/middleware/compat.rs | actix-web/src/middleware/compat.rs | //! For middleware documentation, see [`Compat`].
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
use futures_core::{future::LocalBoxFuture, ready};
use pin_project_lite::pin_project;
use crate::{
body::{BoxBody, MessageBody},
dev::{Service, Transform},
error::Error,
servic... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/test/test_services.rs | actix-web/src/test/test_services.rs | use actix_utils::future::ok;
use crate::{
body::BoxBody,
dev::{fn_service, Service, ServiceRequest, ServiceResponse},
http::StatusCode,
Error, HttpResponseBuilder,
};
/// Creates service that always responds with `200 OK` and no body.
pub fn ok_service(
) -> impl Service<ServiceRequest, Response = Ser... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/test/test_utils.rs | actix-web/src/test/test_utils.rs | use std::error::Error as StdError;
use actix_http::Request;
use actix_service::IntoServiceFactory;
use serde::de::DeserializeOwned;
use crate::{
body::{self, MessageBody},
config::AppConfig,
dev::{Service, ServiceFactory},
service::ServiceResponse,
web::Bytes,
Error,
};
/// Initialize service... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/test/test_request.rs | actix-web/src/test/test_request.rs | use std::{borrow::Cow, net::SocketAddr, rc::Rc};
use actix_http::{test::TestRequest as HttpTestRequest, Request};
use serde::Serialize;
#[cfg(feature = "cookies")]
use crate::cookie::{Cookie, CookieJar};
use crate::{
app_service::AppInitServiceState,
config::AppConfig,
data::Data,
dev::{Extensions, Pa... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/test/mod.rs | actix-web/src/test/mod.rs | //! Various helpers for Actix applications to use during testing.
//!
//! # Initializing A Test Service
//! - [`init_service`]
//!
//! # Off-The-Shelf Test Services
//! - [`ok_service`]
//! - [`status_service`]
//!
//! # Calling Test Service
//! - [`TestRequest`]
//! - [`call_service`]
//! - [`try_call_service`]
//! - ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/html.rs | actix-web/src/types/html.rs | //! Semantic HTML responder. See [`Html`].
use crate::{
http::{
header::{self, ContentType, TryIntoHeaderValue},
StatusCode,
},
HttpRequest, HttpResponse, Responder,
};
/// Semantic HTML responder.
///
/// When used as a responder, creates a 200 OK response, sets the correct HTML content t... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/path.rs | actix-web/src/types/path.rs | //! For path segment extractor documentation, see [`Path`].
use std::sync::Arc;
use actix_router::PathDeserializer;
use actix_utils::future::{ready, Ready};
use derive_more::{AsRef, Deref, DerefMut, Display, From};
use serde::de;
use crate::{
dev::Payload,
error::{Error, ErrorNotFound, PathError},
web::D... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/form.rs | actix-web/src/types/form.rs | //! For URL encoded form helper documentation, see [`Form`].
use std::{
borrow::Cow,
fmt,
future::Future,
ops,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_http::Payload;
use bytes::BytesMut;
use encoding_rs::{Encoding, UTF_8};
use futures_core::{future::LocalBoxFuture, ready};
us... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/json.rs | actix-web/src/types/json.rs | //! For JSON helper documentation, see [`Json`].
use std::{
fmt,
future::Future,
marker::PhantomData,
ops,
pin::Pin,
sync::Arc,
task::{Context, Poll},
};
use actix_http::Payload;
use bytes::BytesMut;
use futures_core::{ready, Stream as _};
use serde::{de::DeserializeOwned, Serialize};
#[c... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/header.rs | actix-web/src/types/header.rs | //! For header extractor helper documentation, see [`Header`](crate::types::Header).
use std::{fmt, ops};
use actix_utils::future::{ready, Ready};
use crate::{
dev::Payload, error::ParseError, extract::FromRequest, http::header::Header as ParseHeader,
HttpRequest,
};
/// Extract typed headers from the reque... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/either.rs | actix-web/src/types/either.rs | //! For either helper, see [`Either`].
use std::{
future::Future,
mem,
pin::Pin,
task::{Context, Poll},
};
use bytes::Bytes;
use futures_core::ready;
use pin_project_lite::pin_project;
use crate::{
body::EitherBody,
dev,
web::{Form, Json},
Error, FromRequest, HttpRequest, HttpResponse... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/mod.rs | actix-web/src/types/mod.rs | //! Common extractors and responders.
mod either;
mod form;
mod header;
mod html;
mod json;
mod path;
mod payload;
mod query;
mod readlines;
pub use self::{
either::{Either, EitherExtractError},
form::{Form, FormConfig, UrlEncoded},
header::Header,
html::Html,
json::{Json, JsonBody, JsonConfig},
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/payload.rs | actix-web/src/types/payload.rs | //! Basic binary and string payload extractors.
use std::{
borrow::Cow,
future::Future,
pin::Pin,
str,
task::{Context, Poll},
};
use actix_http::error::PayloadError;
use actix_utils::future::{ready, Either, Ready};
use bytes::{Bytes, BytesMut};
use encoding_rs::{Encoding, UTF_8};
use futures_core:... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/readlines.rs | actix-web/src/types/readlines.rs | //! For request line reader documentation, see [`Readlines`].
use std::{
borrow::Cow,
pin::Pin,
str,
task::{Context, Poll},
};
use bytes::{Bytes, BytesMut};
use encoding_rs::{Encoding, UTF_8};
use futures_core::{ready, stream::Stream};
use crate::{
dev::Payload,
error::{PayloadError, Readline... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/types/query.rs | actix-web/src/types/query.rs | //! For query parameter extractor documentation, see [`Query`].
use std::{fmt, ops, sync::Arc};
use actix_utils::future::{ok, ready, Ready};
use serde::de::DeserializeOwned;
use crate::{dev::Payload, error::QueryPayloadError, Error, FromRequest, HttpRequest};
/// Extract typed information from the request's query.
... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/guard/acceptable.rs | actix-web/src/guard/acceptable.rs | use super::{Guard, GuardContext};
use crate::http::header::Accept;
/// A guard that verifies that an `Accept` header is present and it contains a compatible MIME type.
///
/// An exception is that matching `*/*` must be explicitly enabled because most browsers send this
/// as part of their `Accept` header for almost ... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/guard/mod.rs | actix-web/src/guard/mod.rs | //! Route guards.
//!
//! Guards are used during routing to help select a matching service or handler using some aspect of
//! the request; though guards should not be used for path matching since it is a built-in function
//! of the Actix Web router.
//!
//! Guards can be used on [`Scope`]s, [`Resource`]s, [`Route`]s,... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/guard/host.rs | actix-web/src/guard/host.rs | use actix_http::{header, uri::Uri, RequestHead, Version};
use super::{Guard, GuardContext};
/// Creates a guard that matches requests targeting a specific host.
///
/// # Matching Host
/// This guard will:
/// - match against the `Host` header, if present;
/// - fall-back to matching against the request target's host... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
actix/actix-web | https://github.com/actix/actix-web/blob/024addfc4063814ba9ddd5e0ac06992e74b98e5b/actix-web/src/response/builder.rs | actix-web/src/response/builder.rs | use std::{
cell::{Ref, RefMut},
future::Future,
pin::Pin,
task::{Context, Poll},
};
use actix_http::{error::HttpError, Response, ResponseHead};
use bytes::Bytes;
use futures_core::Stream;
use serde::Serialize;
use crate::{
body::{BodyStream, BoxBody, MessageBody, SizedStream},
dev::Extensions,... | rust | Apache-2.0 | 024addfc4063814ba9ddd5e0ac06992e74b98e5b | 2026-01-04T15:37:59.021020Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.