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
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/build.rs
build.rs
/// The version string isn’t the simplest: we want to show the version, /// current Git hash, and compilation date when building *debug* versions, but /// just the version for *release* versions so the builds are reproducible. /// /// This script generates the string from the environment variables that Cargo /// adds (...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/logger.rs
src/logger.rs
//! Debug error logging. use std::ffi::OsStr; use ansi_term::{Colour, ANSIString}; /// Sets the internal logger, changing the log level based on the value of an /// environment variable. pub fn configure<T: AsRef<OsStr>>(ev: Option<T>) { let ev = match ev { Some(v) => v, None => return, ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/main.rs
src/main.rs
#![warn(deprecated_in_future)] #![warn(future_incompatible)] #![warn(nonstandard_style)] #![warn(rust_2018_compatibility)] #![warn(rust_2018_idioms)] #![warn(trivial_casts, trivial_numeric_casts)] #![warn(unused)] #![warn(clippy::all, clippy::pedantic)] #![allow(clippy::cast_precision_loss)] #![allow(clippy::cast_poss...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/dir_action.rs
src/options/dir_action.rs
//! Parsing the options for `DirAction`. use crate::options::parser::MatchedFlags; use crate::options::{flags, OptionsError, NumberSource}; use crate::fs::dir_action::{DirAction, RecurseOptions}; impl DirAction { /// Determine which action to perform when trying to list a directory. /// There are three pos...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/vars.rs
src/options/vars.rs
use std::ffi::OsString; // General variables /// Environment variable used to colour files, both by their filesystem type /// (symlink, socket, directory) and their file name or extension (image, /// video, archive); pub static LS_COLORS: &str = "LS_COLORS"; /// Environment variable used to override the width of th...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/theme.rs
src/options/theme.rs
use crate::options::{flags, vars, Vars, OptionsError}; use crate::options::parser::MatchedFlags; use crate::theme::{Options, UseColours, ColourScale, Definitions}; impl Options { pub fn deduce<V: Vars>(matches: &MatchedFlags<'_>, vars: &V) -> Result<Self, OptionsError> { let use_colours = UseColours::dedu...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/version.rs
src/options/version.rs
//! Printing the version string. //! //! The code that works out which string to print is done in `build.rs`. use std::fmt; use crate::options::flags; use crate::options::parser::MatchedFlags; #[derive(PartialEq, Eq, Debug, Copy, Clone)] pub struct VersionString; // There were options here once, but there aren’t an...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/file_name.rs
src/options/file_name.rs
use crate::options::{flags, OptionsError, NumberSource}; use crate::options::parser::MatchedFlags; use crate::options::vars::{self, Vars}; use crate::output::file_name::{Options, Classify, ShowIcons}; impl Options { pub fn deduce<V: Vars>(matches: &MatchedFlags<'_>, vars: &V) -> Result<Self, OptionsError> { ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/parser.rs
src/options/parser.rs
//! A general parser for command-line options. //! //! exa uses its own hand-rolled parser for command-line options. It supports //! the following syntax: //! //! - Long options: `--inode`, `--grid` //! - Long options with values: `--sort size`, `--level=4` //! - Short options: `-i`, `-G` //! - Short options with value...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/view.rs
src/options/view.rs
use crate::fs::feature::xattr; use crate::options::{flags, OptionsError, NumberSource, Vars}; use crate::options::parser::MatchedFlags; use crate::output::{View, Mode, TerminalWidth, grid, details}; use crate::output::grid_details::{self, RowThreshold}; use crate::output::file_name::Options as FileStyle; use crate::out...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/filter.rs
src/options/filter.rs
//! Parsing the options for `FileFilter`. use crate::fs::DotFilter; use crate::fs::filter::{FileFilter, SortField, SortCase, IgnorePatterns, GitIgnore}; use crate::options::{flags, OptionsError}; use crate::options::parser::MatchedFlags; impl FileFilter { /// Determines which of all the file filter options to ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/help.rs
src/options/help.rs
use std::fmt; use crate::fs::feature::xattr; use crate::options::flags; use crate::options::parser::MatchedFlags; static USAGE_PART1: &str = "Usage: exa [options] [files...] META OPTIONS -?, --help show list of command-line options -v, --version show version of exa DISPLAY OPTIONS -1, --onelin...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/flags.rs
src/options/flags.rs
use crate::options::parser::{Arg, Args, TakesValue, Values}; // exa options pub static VERSION: Arg = Arg { short: Some(b'v'), long: "version", takes_value: TakesValue::Forbidden }; pub static HELP: Arg = Arg { short: Some(b'?'), long: "help", takes_value: TakesValue::Forbidden }; // display options pub stat...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/error.rs
src/options/error.rs
use std::ffi::OsString; use std::fmt; use std::num::ParseIntError; use crate::options::flags; use crate::options::parser::{Arg, Flag, ParseError}; /// Something wrong with the combination of options the user has picked. #[derive(PartialEq, Eq, Debug)] pub enum OptionsError { /// There was an error (from `getopt...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/options/mod.rs
src/options/mod.rs
//! Parsing command-line strings into exa options. //! //! This module imports exa’s configuration types, such as `View` (the details //! of displaying multiple files) and `DirAction` (what to do when encountering //! a directory), and implements `deduce` methods on them so they can be //! configured using command-line...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/theme/ui_styles.rs
src/theme/ui_styles.rs
use ansi_term::Style; use crate::theme::lsc::Pair; #[derive(Debug, Default, PartialEq)] pub struct UiStyles { pub colourful: bool, pub filekinds: FileKinds, pub perms: Permissions, pub size: Size, pub users: Users, pub links: Links, pub git: Git, pub pun...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/theme/default_theme.rs
src/theme/default_theme.rs
use ansi_term::Style; use ansi_term::Colour::*; use crate::theme::ColourScale; use crate::theme::ui_styles::*; impl UiStyles { pub fn default_theme(scale: ColourScale) -> Self { Self { colourful: true, filekinds: FileKinds { normal: Style::default(), ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/theme/mod.rs
src/theme/mod.rs
use ansi_term::Style; use crate::fs::File; use crate::output::file_name::Colours as FileNameColours; use crate::output::render; mod ui_styles; pub use self::ui_styles::UiStyles; pub use self::ui_styles::Size as SizeColours; mod lsc; pub use self::lsc::LSColors; mod default_theme; #[derive(PartialEq, Eq, Debug)] p...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/theme/lsc.rs
src/theme/lsc.rs
use std::iter::Peekable; use std::ops::FnMut; use ansi_term::{Colour, Style}; use ansi_term::Colour::*; // Parsing the LS_COLORS environment variable into a map of names to Style values. // // This is sitting around undocumented at the moment because it’s a feature // that should really be unnecessary! exa highlight...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/dir_action.rs
src/fs/dir_action.rs
//! What to do when encountering a directory? /// The action to take when trying to list a file that turns out to be a /// directory. /// /// By default, exa will display the information about files passed in as /// command-line arguments, with one file per entry. However, if a directory /// is passed in, exa assumes ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/filter.rs
src/fs/filter.rs
//! Filtering and sorting the list of files before displaying them. use std::cmp::Ordering; use std::iter::FromIterator; #[cfg(unix)] use std::os::unix::fs::MetadataExt; use crate::fs::DotFilter; use crate::fs::File; /// The **file filter** processes a list of files before displaying them to /// the user, by removi...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/fields.rs
src/fs/fields.rs
//! Wrapper types for the values returned from `File`s. //! //! The methods of `File` that return information about the entry on the //! filesystem -- size, modification date, block count, or Git status -- used //! to just return these as formatted strings, but this became inflexible once //! customisable output styles...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/file.rs
src/fs/file.rs
//! Files, and methods and fields to access their metadata. use std::io; #[cfg(unix)] use std::os::unix::fs::{FileTypeExt, MetadataExt, PermissionsExt}; #[cfg(windows)] use std::os::windows::fs::MetadataExt; use std::path::{Path, PathBuf}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use log::*; use crate::fs:...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/mod.rs
src/fs/mod.rs
mod dir; pub use self::dir::{Dir, DotFilter}; mod file; pub use self::file::{File, FileTarget}; pub mod dir_action; pub mod feature; pub mod fields; pub mod filter;
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/dir.rs
src/fs/dir.rs
use crate::fs::feature::git::GitCache; use crate::fs::fields::GitStatus; use std::io; use std::fs; use std::path::{Path, PathBuf}; use std::slice::Iter as SliceIter; use log::*; use crate::fs::File; /// A **Dir** provides a cached list of the file paths in a directory that’s /// being listed. /// /// This object ge...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/feature/xattr.rs
src/fs/feature/xattr.rs
//! Extended attribute support for Darwin and Linux systems. #![allow(trivial_casts)] // for ARM use std::cmp::Ordering; use std::io; use std::path::Path; pub const ENABLED: bool = cfg!(any(target_os = "macos", target_os = "linux")); pub trait FileAttributes { fn attributes(&self) -> io::Result<Vec<Attribute...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/feature/git.rs
src/fs/feature/git.rs
//! Getting the Git status of files and directories. use std::ffi::OsStr; #[cfg(target_family = "unix")] use std::os::unix::ffi::OsStrExt; use std::path::{Path, PathBuf}; use std::sync::Mutex; use log::*; use crate::fs::fields as f; /// A **Git cache** is assembled based on the user’s input arguments. /// /// This...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/fs/feature/mod.rs
src/fs/feature/mod.rs
pub mod xattr; #[cfg(feature = "git")] pub mod git; #[cfg(not(feature = "git"))] pub mod git { use std::iter::FromIterator; use std::path::{Path, PathBuf}; use crate::fs::fields as f; pub struct GitCache; impl FromIterator<PathBuf> for GitCache { fn from_iter<I>(_iter: I) -> Self ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/info/filetype.rs
src/info/filetype.rs
//! Tests for various types of file (video, image, compressed, etc). //! //! Currently this is dependent on the file’s name and extension, because //! those are the only metadata that we have access to without reading the //! file’s contents. use ansi_term::Style; use crate::fs::File; use crate::output::icons::FileIc...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/info/mod.rs
src/info/mod.rs
//! The “info” module contains routines that aren’t about probing the //! filesystem nor displaying output to the user, but are internal “business //! logic” routines that are performed on a file’s already-read metadata. //! (This counts the file name as metadata.) pub mod filetype; mod sources;
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/info/sources.rs
src/info/sources.rs
use std::path::PathBuf; use crate::fs::File; impl<'a> File<'a> { /// For this file, return a vector of alternate file paths that, if any of /// them exist, mean that *this* file should be coloured as “compiled”. /// /// The point of this is to highlight compiled files such as `foo.js` when /// t...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/file_name.rs
src/output/file_name.rs
use std::fmt::Debug; use std::path::Path; use ansi_term::{ANSIString, Style}; use crate::fs::{File, FileTarget}; use crate::output::cell::TextCellContents; use crate::output::escape; use crate::output::icons::{icon_for_file, iconify_style}; use crate::output::render::FiletypeColours; /// Basically a file name facto...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/grid_details.rs
src/output/grid_details.rs
//! The grid-details view lists several details views side-by-side. use std::io::{self, Write}; use ansi_term::ANSIStrings; use term_grid as grid; use crate::fs::{Dir, File}; use crate::fs::feature::git::GitCache; use crate::fs::feature::xattr::FileAttributes; use crate::fs::filter::FileFilter; use crate::output::ce...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/icons.rs
src/output/icons.rs
use ansi_term::Style; use crate::fs::File; use crate::info::filetype::FileExtensions; use lazy_static::lazy_static; use std::collections::HashMap; pub trait FileIcon { fn icon_file(&self, file: &File<'_>) -> Option<char>; } #[derive(Copy, Clone)] pub enum Icons { Audio, Image, Video, } impl Icons ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/time.rs
src/output/time.rs
//! Timestamp formatting. use std::time::{SystemTime, UNIX_EPOCH}; use datetime::{LocalDateTime, TimeZone, DatePiece, TimePiece}; use datetime::fmt::DateFormat; use lazy_static::lazy_static; use unicode_width::UnicodeWidthStr; /// Every timestamp in exa needs to be rendered by a **time format**. /// Formatting tim...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/table.rs
src/output/table.rs
use std::cmp::max; use std::env; use std::ops::Deref; #[cfg(unix)] use std::sync::{Mutex, MutexGuard}; use datetime::TimeZone; use zoneinfo_compiled::{CompiledData, Result as TZResult}; use lazy_static::lazy_static; use log::*; #[cfg(unix)] use users::UsersCache; use crate::fs::{File, fields as f}; use crate::fs::fe...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/tree.rs
src/output/tree.rs
//! Tree structures, such as `├──` or `└──`, used in a tree view. //! //! ## Constructing Tree Views //! //! When using the `--tree` argument, instead of a vector of cells, each row //! has a `depth` field that indicates how far deep in the tree it is: the top //! level has depth 0, its children have depth 1, and *thei...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/grid.rs
src/output/grid.rs
use std::io::{self, Write}; use term_grid as tg; use crate::fs::File; use crate::fs::filter::FileFilter; use crate::output::file_name::Options as FileStyle; use crate::theme::Theme; #[derive(PartialEq, Eq, Debug, Copy, Clone)] pub struct Options { pub across: bool, } impl Options { pub fn direction(self) -...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/mod.rs
src/output/mod.rs
pub use self::cell::{TextCell, TextCellContents, DisplayWidth}; pub use self::escape::escape; pub mod details; pub mod file_name; pub mod grid; pub mod grid_details; pub mod icons; pub mod lines; pub mod render; pub mod table; pub mod time; mod cell; mod escape; mod tree; /// The **view** contains all information a...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/lines.rs
src/output/lines.rs
use std::io::{self, Write}; use ansi_term::ANSIStrings; use crate::fs::File; use crate::fs::filter::FileFilter; use crate::output::cell::TextCellContents; use crate::output::file_name::{Options as FileStyle}; use crate::theme::Theme; /// The lines view literally just displays each file, line-by-line. pub struct Ren...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/details.rs
src/output/details.rs
//! The **Details** output view displays each file as a row in a table. //! //! It’s used in the following situations: //! //! - Most commonly, when using the `--long` command-line argument to display the //! details of each file, which requires using a table view to hold all the data; //! - When using the `--tree` a...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/escape.rs
src/output/escape.rs
use ansi_term::{ANSIString, Style}; pub fn escape(string: String, bits: &mut Vec<ANSIString<'_>>, good: Style, bad: Style) { if string.chars().all(|c| c >= 0x20 as char && c != 0x7f as char) { bits.push(good.paint(string)); return; } for c in string.chars() { // The `escape_defaul...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/cell.rs
src/output/cell.rs
//! The `TextCell` type for the details and lines views. use std::iter::Sum; use std::ops::{Add, Deref, DerefMut}; use ansi_term::{Style, ANSIString, ANSIStrings}; use unicode_width::UnicodeWidthStr; /// An individual cell that holds text in a table, used in the details and /// lines views to store ANSI-terminal-fo...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/permissions.rs
src/output/render/permissions.rs
use ansi_term::{ANSIString, Style}; use crate::fs::fields as f; use crate::output::cell::{TextCell, DisplayWidth}; use crate::output::render::FiletypeColours; impl f::PermissionsPlus { #[cfg(unix)] pub fn render<C: Colours+FiletypeColours>(&self, colours: &C) -> TextCell { let mut chars = vec![ self....
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/times.rs
src/output/render/times.rs
use std::time::SystemTime; use datetime::TimeZone; use ansi_term::Style; use crate::output::cell::TextCell; use crate::output::time::TimeFormat; pub trait Render { fn render(self, style: Style, tz: &Option<TimeZone>, format: TimeFormat) -> TextCell; } impl Render for Option<SystemTime> { fn render(self, st...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/filetype.rs
src/output/render/filetype.rs
use ansi_term::{ANSIString, Style}; use crate::fs::fields as f; impl f::Type { pub fn render<C: Colours>(self, colours: &C) -> ANSIString<'static> { match self { Self::File => colours.normal().paint("."), Self::Directory => colours.directory().paint("d"), Se...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/git.rs
src/output/render/git.rs
use ansi_term::{ANSIString, Style}; use crate::output::cell::{TextCell, DisplayWidth}; use crate::fs::fields as f; impl f::Git { pub fn render(self, colours: &dyn Colours) -> TextCell { TextCell { width: DisplayWidth::from(2), contents: vec![ self.staged.render(col...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/inode.rs
src/output/render/inode.rs
use ansi_term::Style; use crate::fs::fields as f; use crate::output::cell::TextCell; impl f::Inode { pub fn render(self, style: Style) -> TextCell { TextCell::paint(style, self.0.to_string()) } } #[cfg(test)] pub mod test { use crate::output::cell::TextCell; use crate::fs::fields as f; ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/users.rs
src/output/render/users.rs
use ansi_term::Style; use users::Users; use crate::fs::fields as f; use crate::output::cell::TextCell; use crate::output::table::UserFormat; impl f::User { pub fn render<C: Colours, U: Users>(self, colours: &C, users: &U, format: UserFormat) -> TextCell { let user_name = match (format, users.get_user_by_...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/octal.rs
src/output/render/octal.rs
use ansi_term::Style; use crate::fs::fields as f; use crate::output::cell::TextCell; impl f::OctalPermissions { fn bits_to_octal(r: bool, w: bool, x: bool) -> u8 { u8::from(r) * 4 + u8::from(w) * 2 + u8::from(x) } pub fn render(&self, style: Style) -> TextCell { let perm = &self.permissi...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/mod.rs
src/output/render/mod.rs
mod blocks; pub use self::blocks::Colours as BlocksColours; mod filetype; pub use self::filetype::Colours as FiletypeColours; mod git; pub use self::git::Colours as GitColours; #[cfg(unix)] mod groups; #[cfg(unix)] pub use self::groups::Colours as GroupColours; mod inode; // inode uses just one colour mod links; p...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/links.rs
src/output/render/links.rs
use ansi_term::Style; use locale::Numeric as NumericLocale; use crate::fs::fields as f; use crate::output::cell::TextCell; impl f::Links { pub fn render<C: Colours>(&self, colours: &C, numeric: &NumericLocale) -> TextCell { let style = if self.multiple { colours.multi_link_file() } ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/groups.rs
src/output/render/groups.rs
use ansi_term::Style; use users::{Users, Groups}; use crate::fs::fields as f; use crate::output::cell::TextCell; use crate::output::table::UserFormat; impl f::Group { pub fn render<C: Colours, U: Users+Groups>(self, colours: &C, users: &U, format: UserFormat) -> TextCell { use users::os::unix::GroupExt; ...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/blocks.rs
src/output/render/blocks.rs
use ansi_term::Style; use crate::fs::fields as f; use crate::output::cell::TextCell; impl f::Blocks { pub fn render<C: Colours>(&self, colours: &C) -> TextCell { match self { Self::Some(blk) => TextCell::paint(colours.block_count(), blk.to_string()), Self::None => TextCell:...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
ogham/exa
https://github.com/ogham/exa/blob/3d1edbb47052cb416ef9478106c3907586da5150/src/output/render/size.rs
src/output/render/size.rs
use ansi_term::Style; use locale::Numeric as NumericLocale; use number_prefix::Prefix; use crate::fs::fields as f; use crate::output::cell::{TextCell, DisplayWidth}; use crate::output::table::SizeFormat; impl f::Size { pub fn render<C: Colours>(self, colours: &C, size_format: SizeFormat, numerics: &NumericLocale...
rust
MIT
3d1edbb47052cb416ef9478106c3907586da5150
2026-01-04T15:37:45.366656Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/lib.rs
axum/src/lib.rs
//! axum is a web application framework that focuses on ergonomics and modularity. //! //! # High-level features //! //! - Route requests to handlers with a macro-free API. //! - Declaratively parse requests using extractors. //! - Simple and predictable error handling model. //! - Generate responses with minimal boile...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/form.rs
axum/src/form.rs
use crate::extract::Request; use crate::extract::{rejection::*, FromRequest, RawForm}; use axum_core::response::{IntoResponse, Response}; use axum_core::RequestExt; use http::header::CONTENT_TYPE; use http::StatusCode; use serde_core::{de::DeserializeOwned, Serialize}; /// URL encoded extractor and response. /// /// #...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extension.rs
axum/src/extension.rs
use crate::{extract::rejection::*, response::IntoResponseParts}; use axum_core::extract::OptionalFromRequestParts; use axum_core::{ extract::FromRequestParts, response::{IntoResponse, Response, ResponseParts}, }; use http::{request::Parts, Extensions, Request}; use std::{ convert::Infallible, task::{Con...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/json.rs
axum/src/json.rs
use crate::extract::Request; use crate::extract::{rejection::*, FromRequest}; use axum_core::extract::OptionalFromRequest; use axum_core::response::{IntoResponse, Response}; use bytes::{BufMut, Bytes, BytesMut}; use http::{ header::{self, HeaderMap, HeaderValue}, StatusCode, }; use serde_core::{de::DeserializeO...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/util.rs
axum/src/util.rs
use axum_core::response::{IntoResponse, Response}; use pin_project_lite::pin_project; use std::{ future::Future, ops::Deref, pin::Pin, sync::Arc, task::{ready, Context, Poll}, }; use tower::Service; #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub(crate) struct PercentDecodedStr(Arc<str>); impl Pe...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/macros.rs
axum/src/macros.rs
//! Internal macros macro_rules! opaque_future { ($(#[$m:meta])* pub type $name:ident = $actual:ty;) => { opaque_future! { $(#[$m])* pub type $name<> = $actual; } }; ($(#[$m:meta])* pub type $name:ident<$($param:ident),*> = $actual:ty;) => { pin_project_lite...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/boxed.rs
axum/src/boxed.rs
use std::{convert::Infallible, fmt}; use crate::extract::Request; use tower::Service; use crate::{ handler::Handler, routing::{future::RouteFuture, Route}, Router, }; pub(crate) struct BoxedIntoRoute<S, E>(Box<dyn ErasedIntoRoute<S, E>>); impl<S> BoxedIntoRoute<S, Infallible> where S: Clone + Send +...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/service_ext.rs
axum/src/service_ext.rs
use crate::error_handling::HandleError; #[cfg(feature = "tokio")] use crate::extract::connect_info::IntoMakeServiceWithConnectInfo; use crate::routing::IntoMakeService; use tower_service::Service; /// Extension trait that adds additional methods to any [`Service`]. pub trait ServiceExt<R>: Service<R> + Sized { ///...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/connect_info.rs
axum/src/extract/connect_info.rs
//! Extractor for getting connection information from a client. //! //! See [`Router::into_make_service_with_connect_info`] for more details. //! //! [`Router::into_make_service_with_connect_info`]: crate::routing::Router::into_make_service_with_connect_info use crate::extension::AddExtension; use super::{Extension, ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/raw_query.rs
axum/src/extract/raw_query.rs
use super::FromRequestParts; use http::request::Parts; use std::convert::Infallible; /// Extractor that extracts the raw query string, without parsing it. /// /// # Example /// /// ```rust,no_run /// use axum::{ /// extract::RawQuery, /// routing::get, /// Router, /// }; /// use futures_util::StreamExt; //...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/multipart.rs
axum/src/extract/multipart.rs
//! Extractor that parses `multipart/form-data` requests commonly used with file uploads. //! //! See [`Multipart`] for more details. use super::{FromRequest, Request}; use crate::body::Bytes; use axum_core::{ __composite_rejection as composite_rejection, __define_rejection as define_rejection, extract::Option...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/state.rs
axum/src/extract/state.rs
use axum_core::extract::{FromRef, FromRequestParts}; use http::request::Parts; use std::{ convert::Infallible, ops::{Deref, DerefMut}, }; /// Extractor for state. /// /// See ["Accessing state in middleware"][state-from-middleware] for how to /// access state in middleware. /// /// State is global and used in ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/nested_path.rs
axum/src/extract/nested_path.rs
use std::{ sync::Arc, task::{Context, Poll}, }; use crate::extract::Request; use axum_core::extract::FromRequestParts; use http::request::Parts; use tower_layer::{layer_fn, Layer}; use tower_service::Service; use super::rejection::NestedPathRejection; /// Access the path the matched the route is nested at. /...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/raw_form.rs
axum/src/extract/raw_form.rs
use axum_core::extract::{FromRequest, Request}; use bytes::Bytes; use http::Method; use super::{ has_content_type, rejection::{InvalidFormContentType, RawFormRejection}, }; /// Extractor that extracts raw form requests. /// /// For `GET` requests it will extract the raw query. For other methods it extracts th...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/mod.rs
axum/src/extract/mod.rs
#![doc = include_str!("../docs/extract.md")] use http::header::{self, HeaderMap}; #[cfg(feature = "tokio")] pub mod connect_info; pub mod path; pub mod rejection; #[cfg(feature = "ws")] pub mod ws; pub(crate) mod nested_path; #[cfg(feature = "original-uri")] mod original_uri; mod raw_form; mod raw_query; mod state;...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/ws.rs
axum/src/extract/ws.rs
//! Handle WebSocket connections. //! //! # Example //! //! ``` //! use axum::{ //! extract::ws::{WebSocketUpgrade, WebSocket}, //! routing::any, //! response::{IntoResponse, Response}, //! Router, //! }; //! //! let app = Router::new().route("/ws", any(handler)); //! //! async fn handler(ws: WebSocketU...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
true
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/rejection.rs
axum/src/extract/rejection.rs
//! Rejection response types. use axum_core::__composite_rejection as composite_rejection; use axum_core::__define_rejection as define_rejection; pub use crate::extract::path::{FailedToDeserializePathParams, InvalidUtf8InPathParam}; pub use axum_core::extract::rejection::*; #[cfg(feature = "json")] define_rejection!...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/query.rs
axum/src/extract/query.rs
use super::{rejection::*, FromRequestParts}; use http::{request::Parts, Uri}; use serde_core::de::DeserializeOwned; /// Extractor that deserializes query strings into some type. /// /// `T` is expected to implement [`serde::Deserialize`]. /// /// # Examples /// /// ```rust,no_run /// use axum::{ /// extract::Query...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/matched_path.rs
axum/src/extract/matched_path.rs
use super::{rejection::*, FromRequestParts}; use crate::routing::{RouteId, NEST_TAIL_PARAM_CAPTURE}; use axum_core::extract::OptionalFromRequestParts; use http::request::Parts; use std::{collections::HashMap, convert::Infallible, sync::Arc}; /// Access the path in the router that matches the request. /// /// ``` /// u...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/original_uri.rs
axum/src/extract/original_uri.rs
use super::{Extension, FromRequestParts}; use http::{request::Parts, Uri}; use std::convert::Infallible; /// Extractor that gets the original request URI regardless of nesting. /// /// This is necessary since [`Uri`](http::Uri), when used as an extractor, will /// have the prefix stripped if used in a nested service. ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/path/mod.rs
axum/src/extract/path/mod.rs
//! Extractor that will get captures from the URL and parse them using //! [`serde`]. mod de; use crate::{ extract::{rejection::*, FromRequestParts}, routing::url_params::UrlParams, util::PercentDecodedStr, }; use axum_core::{ extract::OptionalFromRequestParts, response::{IntoResponse, Response}, ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/extract/path/de.rs
axum/src/extract/path/de.rs
use super::{ErrorKind, PathDeserializationError}; use crate::util::PercentDecodedStr; use serde_core::{ de::{self, DeserializeSeed, EnumAccess, Error, MapAccess, SeqAccess, VariantAccess, Visitor}, forward_to_deserialize_any, Deserializer, }; use std::{any::type_name, sync::Arc}; macro_rules! unsupported_type ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/strip_prefix.rs
axum/src/routing/strip_prefix.rs
use http::{Request, Uri}; use std::{ sync::Arc, task::{Context, Poll}, }; use tower::Layer; use tower_layer::layer_fn; use tower_service::Service; #[derive(Clone)] pub(super) struct StripPrefix<S> { inner: S, prefix: Arc<str>, } impl<S> StripPrefix<S> { pub(super) fn layer(prefix: &str) -> impl La...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/future.rs
axum/src/routing/future.rs
//! Future types. pub use super::{ into_make_service::IntoMakeServiceFuture, route::{InfallibleRouteFuture, RouteFuture}, };
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/url_params.rs
axum/src/routing/url_params.rs
use crate::util::PercentDecodedStr; use http::Extensions; use matchit::Params; use std::sync::Arc; #[derive(Clone)] pub(crate) enum UrlParams { Params(Vec<(Arc<str>, PercentDecodedStr)>), InvalidUtf8InPathParam { key: Arc<str> }, } pub(super) fn insert_url_params(extensions: &mut Extensions, params: &Params<'...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/method_routing.rs
axum/src/routing/method_routing.rs
//! Route to services and handlers based on HTTP methods. use super::{future::InfallibleRouteFuture, IntoMakeService}; #[cfg(feature = "tokio")] use crate::extract::connect_info::IntoMakeServiceWithConnectInfo; use crate::{ body::{Body, Bytes, HttpBody}, boxed::BoxedIntoRoute, error_handling::{HandleError,...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
true
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/not_found.rs
axum/src/routing/not_found.rs
use crate::response::Response; use axum_core::response::IntoResponse; use http::{Request, StatusCode}; use std::{ convert::Infallible, future::ready, task::{Context, Poll}, }; use tower_service::Service; /// A [`Service`] that responds with `404 Not Found` to all requests. /// /// This is used as the botto...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/mod.rs
axum/src/routing/mod.rs
//! Routing between [`Service`]s and handlers. use self::{future::RouteFuture, not_found::NotFound, path_router::PathRouter}; #[cfg(feature = "tokio")] use crate::extract::connect_info::IntoMakeServiceWithConnectInfo; #[cfg(feature = "matched-path")] use crate::extract::MatchedPath; use crate::{ body::{Body, HttpB...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/route.rs
axum/src/routing/route.rs
use crate::{ body::{Body, HttpBody}, response::Response, util::MapIntoResponse, }; use axum_core::{extract::Request, response::IntoResponse}; use bytes::Bytes; use http::{ header::{self, CONTENT_LENGTH}, HeaderMap, HeaderValue, Method, }; use pin_project_lite::pin_project; use std::{ convert::In...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/method_filter.rs
axum/src/routing/method_filter.rs
use http::Method; use std::{ fmt, fmt::{Debug, Formatter}, }; /// A filter that matches one or more HTTP methods. #[derive(Debug, Copy, Clone, PartialEq)] pub struct MethodFilter(u16); impl MethodFilter { /// Match `CONNECT` requests. /// /// This is useful for implementing HTTP/2's [extended CONN...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/path_router.rs
axum/src/routing/path_router.rs
use crate::{ extract::{nested_path::SetNestedPath, Request}, handler::Handler, }; use axum_core::response::IntoResponse; use matchit::MatchError; use std::{borrow::Cow, collections::HashMap, convert::Infallible, fmt, sync::Arc}; use tower_layer::Layer; use tower_service::Service; use super::{ future::Route...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/into_make_service.rs
axum/src/routing/into_make_service.rs
use std::{ convert::Infallible, future::ready, task::{Context, Poll}, }; use tower_service::Service; /// A [`MakeService`] that produces axum router services. /// /// [`MakeService`]: tower::make::MakeService #[derive(Debug, Clone)] pub struct IntoMakeService<S> { svc: S, } impl<S> IntoMakeService<S> ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/tests/merge.rs
axum/src/routing/tests/merge.rs
use super::*; use crate::extract::OriginalUri; use serde_json::{json, Value}; use tower::limit::ConcurrencyLimitLayer; #[crate::test] async fn basic() { let one = Router::new() .route("/foo", get(|| async {})) .route("/bar", get(|| async {})); let two = Router::new().route("/baz", get(|| async ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/tests/handle_error.rs
axum/src/routing/tests/handle_error.rs
use super::*; use std::future::pending; use tower::timeout::TimeoutLayer; async fn unit() {} async fn forever() { pending().await } fn timeout() -> TimeoutLayer { TimeoutLayer::new(Duration::from_millis(10)) } #[crate::test] async fn handler() { let app = Router::new().route( "/", get(fo...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/tests/nest.rs
axum/src/routing/tests/nest.rs
use super::*; use std::collections::HashMap; use tower_http::services::ServeDir; #[crate::test] async fn nesting_apps() { let api_routes = Router::new() .route( "/users", get(|| async { "users#index" }).post(|| async { "users#create" }), ) .route( "/users...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/tests/mod.rs
axum/src/routing/tests/mod.rs
use crate::{ body::{Body, Bytes}, error_handling::HandleErrorLayer, extract::{self, DefaultBodyLimit, FromRef, Path, State}, handler::{Handler, HandlerWithoutStateExt}, middleware::{self, Next}, response::{IntoResponse, Response}, routing::{ delete, get, get_service, on, on_service, ...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
true
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/tests/get_to_head.rs
axum/src/routing/tests/get_to_head.rs
use super::*; use http::Method; use tower::ServiceExt; mod for_handlers { use super::*; #[crate::test] async fn get_handles_head() { let app = Router::new().route( "/", get(|| async { let mut headers = HeaderMap::new(); headers.insert("x-some...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/routing/tests/fallback.rs
axum/src/routing/tests/fallback.rs
use super::*; use crate::middleware::{map_request, map_response}; #[crate::test] async fn basic() { let app = Router::new() .route("/foo", get(|| async {})) .fallback(|| async { "fallback" }); let client = TestClient::new(app); assert_eq!(client.get("/foo").await.status(), StatusCode::OK)...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/middleware/from_extractor.rs
axum/src/middleware/from_extractor.rs
use crate::{ extract::FromRequestParts, response::{IntoResponse, Response}, }; use futures_core::future::BoxFuture; use http::Request; use pin_project_lite::pin_project; use std::{ fmt, future::Future, marker::PhantomData, pin::Pin, task::{ready, Context, Poll}, }; use tower_layer::Layer; us...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/middleware/from_fn.rs
axum/src/middleware/from_fn.rs
use axum_core::extract::{FromRequest, FromRequestParts, Request}; use futures_core::future::BoxFuture; use std::{ any::type_name, convert::Infallible, fmt, future::Future, marker::PhantomData, pin::Pin, task::{Context, Poll}, }; use tower::util::BoxCloneSyncService; use tower_layer::Layer; u...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/middleware/mod.rs
axum/src/middleware/mod.rs
//! Utilities for writing middleware //! #![doc = include_str!("../docs/middleware.md")] mod from_extractor; mod from_fn; mod map_request; mod map_response; mod response_axum_body; pub use self::from_extractor::{ from_extractor, from_extractor_with_state, FromExtractor, FromExtractorLayer, }; pub use self::from_f...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/middleware/response_axum_body.rs
axum/src/middleware/response_axum_body.rs
use std::{ error::Error, future::Future, pin::Pin, task::{ready, Context, Poll}, }; use axum_core::{body::Body, response::Response}; use bytes::Bytes; use http_body::Body as HttpBody; use pin_project_lite::pin_project; use tower::{Layer, Service}; /// Layer that transforms the Response body to [`crate...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/middleware/map_request.rs
axum/src/middleware/map_request.rs
use crate::body::{Body, Bytes, HttpBody}; use crate::response::{IntoResponse, Response}; use crate::BoxError; use axum_core::extract::{FromRequest, FromRequestParts}; use futures_core::future::BoxFuture; use http::Request; use std::{ any::type_name, convert::Infallible, fmt, future::Future, marker::...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/middleware/map_response.rs
axum/src/middleware/map_response.rs
use crate::response::{IntoResponse, Response}; use axum_core::extract::FromRequestParts; use futures_core::future::BoxFuture; use http::Request; use std::{ any::type_name, convert::Infallible, fmt, future::Future, marker::PhantomData, pin::Pin, task::{Context, Poll}, }; use tower_layer::Laye...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false
tokio-rs/axum
https://github.com/tokio-rs/axum/blob/183ace306ab126f034c55d9147ea3513c8a5a139/axum/src/test_helpers/tracing_helpers.rs
axum/src/test_helpers/tracing_helpers.rs
use std::{ future::{Future, IntoFuture}, io, marker::PhantomData, pin::Pin, sync::{Arc, Mutex}, }; use serde::{de::DeserializeOwned, Deserialize}; use tracing::instrument::WithSubscriber; use tracing_subscriber::prelude::*; use tracing_subscriber::{filter::Targets, fmt::MakeWriter}; #[derive(Deser...
rust
MIT
183ace306ab126f034c55d9147ea3513c8a5a139
2026-01-04T15:37:41.118512Z
false