Skip to main content

TestContext

Struct TestContext 

Source
pub struct TestContext {
    pub root: ChildPath,
    pub temp_dir: ChildPath,
    pub cache_dir: ChildPath,
    pub python_dir: ChildPath,
    pub home_dir: ChildPath,
    pub user_config_dir: ChildPath,
    pub bin_dir: ChildPath,
    pub venv: ChildPath,
    pub workspace_root: PathBuf,
    pub python_version: Option<PythonVersion>,
    pub python_versions: Vec<(PythonVersion, PathBuf)>,
    /* private fields */
}
Expand description

Create a context for tests which simplifies shared behavior across tests.

  • Set the current directory to a temporary directory (temp_dir).
  • Set the cache dir to a different temporary directory (cache_dir).
  • Set a cutoff for versions used in the resolution so the snapshots don’t change after a new release.
  • Set the venv to a fresh .venv in temp_dir

Fields§

§root: ChildPath§temp_dir: ChildPath§cache_dir: ChildPath§python_dir: ChildPath§home_dir: ChildPath§user_config_dir: ChildPath§bin_dir: ChildPath§venv: ChildPath§workspace_root: PathBuf§python_version: Option<PythonVersion>

The Python version used for the virtual environment, if any.

§python_versions: Vec<(PythonVersion, PathBuf)>

All the Python versions available during this test context.

Implementations§

Source§

impl TestContext

Source

pub fn new_with_bin(python_version: &str, uv_bin: PathBuf) -> Self

Create a new test context with a virtual environment and explicit uv binary path.

This is called by the test_context! macro.

Source

pub fn with_exclude_newer(self, exclude_newer: &str) -> Self

Set the “exclude newer” timestamp for all commands in this context.

Source

pub fn with_http_timeout(self, http_timeout: &str) -> Self

Set the “http timeout” for all commands in this context.

Source

pub fn with_concurrent_installs(self, concurrent_installs: &str) -> Self

Set the “concurrent installs” for all commands in this context.

Source

pub fn with_filtered_counts(self) -> Self

Add extra standard filtering for messages like “Resolved 10 packages” which can differ between platforms.

In some cases, these counts are helpful for the snapshot and should not be filtered.

Source

pub fn with_filtered_cache_size(self) -> Self

Add extra filtering for cache size output

Source

pub fn with_filtered_missing_file_error(self) -> Self

Add extra standard filtering for Windows-compatible missing file errors.

Source

pub fn with_filtered_exe_suffix(self) -> Self

Add extra standard filtering for executable suffixes on the current platform e.g. drops .exe on Windows.

Source

pub fn with_filtered_python_sources(self) -> Self

Add extra standard filtering for Python interpreter sources

Source

pub fn with_filtered_python_names(self) -> Self

Add extra standard filtering for Python executable names, e.g., stripping version number and .exe suffixes.

Source

pub fn with_filtered_virtualenv_bin(self) -> Self

Add extra standard filtering for venv executable directories on the current platform e.g. Scripts on Windows and bin on Unix.

Source

pub fn with_filtered_python_install_bin(self) -> Self

Add extra standard filtering for Python installation bin/ directories, which are not present on Windows but are on Unix. See TestContext::with_filtered_virtualenv_bin for the virtual environment equivalent.

Source

pub fn with_pyvenv_cfg_filters(self) -> Self

Filtering for various keys in a pyvenv.cfg file that will vary depending on the specific machine used:

  • home = foo/bar/baz/python3.X.X/bin
  • uv = X.Y.Z
  • extends-environment = <path/to/parent/venv>

Add extra filtering for -> <PATH> symlink display for Python versions in the test context, e.g., for use in uv python list.

Source

pub fn with_filtered_path(self, path: &Path, name: &str) -> Self

Add extra standard filtering for a given path.

Adds a filter that specifically ignores the link mode warning.

This occurs in some cases and can be used on an ad hoc basis to squash the warning in the snapshots. This is useful because the warning does not consistently appear. It is dependent on the environment. (For example, sometimes it’s dependent on whether /tmp and ~/.local live on the same file system.)

Source

pub fn with_filtered_not_executable(self) -> Self

Adds a filter for platform-specific errors when a file is not executable.

Source

pub fn with_filtered_python_keys(self) -> Self

Adds a filter that ignores platform information in a Python installation key.

Source

pub fn with_filtered_latest_python_versions(self) -> Self

Adds a filter that replaces the latest Python patch versions with [LATEST] placeholder.

Source

pub fn with_filtered_windows_temp_dir(self) -> Self

Add a filter that ignores temporary directory in path.

Source

pub fn with_filtered_compiled_file_count(self) -> Self

Add a filter for (bytecode) compilation file counts

Source

pub fn with_cyclonedx_filters(self) -> Self

Adds filters for non-deterministic CycloneDX data

Source

pub fn with_collapsed_whitespace(self) -> Self

Add a filter that collapses duplicate whitespace.

Source

pub fn with_python_download_cache(self) -> Self

Use a shared global cache for Python downloads.

Source

pub fn with_empty_python_install_mirror(self) -> Self

Source

pub fn with_managed_python_dirs(self) -> Self

Add extra directories and configuration for managed Python installations.

Source

pub fn with_versions_as_managed(self, versions: &[&str]) -> Self

Source

pub fn with_filter(self, filter: (impl Into<String>, impl Into<String>)) -> Self

Add a custom filter to the TestContext.

Source

pub fn with_unset_git_credential_helper(self) -> Self

Source

pub fn clear_filters(self) -> Self

Clear filters on TestContext.

Source

pub fn test_bucket_dir() -> PathBuf

Default to the canonicalized path to the temp directory. We need to do this because on macOS (and Windows on GitHub Actions) the standard temp dir is a symlink. (On macOS, the temporary directory is, like /var/..., which resolves to /private/var/....)

It turns out that, at least on macOS, if we pass a symlink as current_dir, it gets immediately resolved (such that if you call current_dir in the running Command, it returns resolved symlink). This breaks some snapshot tests, since we don’t want to resolve symlinks for user-provided paths.

Source

pub fn new_with_versions_and_bin( python_versions: &[&str], uv_bin: PathBuf, ) -> Self

Create a new test context with multiple Python versions and explicit uv binary path.

Does not create a virtual environment by default, but the first Python version can be used to create a virtual environment with TestContext::create_venv.

This is called by the test_context_with_versions! macro.

Source

pub fn command(&self) -> Command

Create a uv command for testing.

Source

pub fn disallow_git_cli(bin_dir: &Path) -> Result<()>

Source

pub fn with_git_lfs_config(self) -> Self

Setup Git LFS Filters

You can find the default filters in https://github.com/git-lfs/git-lfs/blob/v3.7.1/lfs/attribute.go#L66-L71 We set required to true to get a full stacktrace when these commands fail.

Source

pub fn add_shared_options(&self, command: &mut Command, activate_venv: bool)

Shared behaviour for almost all test commands.

  • Use a temporary cache directory
  • Use a temporary virtual environment with the Python version of Self
  • Don’t wrap text output based on the terminal we’re in, the test output doesn’t get printed but snapshotted to a string.
  • Use a fake HOME to avoid accidentally changing the developer’s machine.
  • Hide other Pythons with UV_PYTHON_INSTALL_DIR and installed interpreters with UV_TEST_PYTHON_PATH and an active venv (if applicable) by removing VIRTUAL_ENV.
  • Increase the stack size to avoid stack overflows on windows due to large async functions.
Source

pub fn add_shared_args(&self, command: &mut Command)

Only the arguments of TestContext::add_shared_options.

Source

pub fn add_shared_env(&self, command: &mut Command, activate_venv: bool)

Only the environment variables of TestContext::add_shared_options.

Source

pub fn pip_compile(&self) -> Command

Create a pip compile command for testing.

Source

pub fn pip_sync(&self) -> Command

Create a pip compile command for testing.

Source

pub fn pip_show(&self) -> Command

Source

pub fn pip_freeze(&self) -> Command

Create a pip freeze command with options shared across scenarios.

Source

pub fn pip_check(&self) -> Command

Create a pip check command with options shared across scenarios.

Source

pub fn pip_list(&self) -> Command

Source

pub fn venv(&self) -> Command

Create a uv venv command

Source

pub fn pip_install(&self) -> Command

Create a pip install command with options shared across scenarios.

Source

pub fn pip_uninstall(&self) -> Command

Create a pip uninstall command with options shared across scenarios.

Source

pub fn pip_tree(&self) -> Command

Create a pip tree command for testing.

Source

pub fn pip_debug(&self) -> Command

Create a pip debug command for testing.

Source

pub fn help(&self) -> Command

Create a uv help command with options shared across scenarios.

Source

pub fn init(&self) -> Command

Create a uv init command with options shared across scenarios and isolated from any git repository that may exist in a parent directory.

Source

pub fn sync(&self) -> Command

Create a uv sync command with options shared across scenarios.

Source

pub fn lock(&self) -> Command

Create a uv lock command with options shared across scenarios.

Source

pub fn workspace_metadata(&self) -> Command

Create a uv workspace metadata command with options shared across scenarios.

Source

pub fn workspace_dir(&self) -> Command

Create a uv workspace dir command with options shared across scenarios.

Source

pub fn workspace_list(&self) -> Command

Create a uv workspace list command with options shared across scenarios.

Source

pub fn export(&self) -> Command

Create a uv export command with options shared across scenarios.

Source

pub fn format(&self) -> Command

Create a uv format command with options shared across scenarios.

Source

pub fn build(&self) -> Command

Create a uv build command with options shared across scenarios.

Source

pub fn version(&self) -> Command

Source

pub fn self_version(&self) -> Command

Source

pub fn self_update(&self) -> Command

Source

pub fn publish(&self) -> Command

Create a uv publish command with options shared across scenarios.

Source

pub fn python_find(&self) -> Command

Create a uv python find command with options shared across scenarios.

Source

pub fn python_list(&self) -> Command

Create a uv python list command with options shared across scenarios.

Source

pub fn python_install(&self) -> Command

Create a uv python install command with options shared across scenarios.

Source

pub fn python_uninstall(&self) -> Command

Create a uv python uninstall command with options shared across scenarios.

Source

pub fn python_upgrade(&self) -> Command

Create a uv python upgrade command with options shared across scenarios.

Source

pub fn python_pin(&self) -> Command

Create a uv python pin command with options shared across scenarios.

Source

pub fn python_dir(&self) -> Command

Create a uv python dir command with options shared across scenarios.

Source

pub fn run(&self) -> Command

Create a uv run command with options shared across scenarios.

Source

pub fn tool_run(&self) -> Command

Create a uv tool run command with options shared across scenarios.

Source

pub fn tool_upgrade(&self) -> Command

Create a uv upgrade run command with options shared across scenarios.

Source

pub fn tool_install(&self) -> Command

Create a uv tool install command with options shared across scenarios.

Source

pub fn tool_list(&self) -> Command

Create a uv tool list command with options shared across scenarios.

Source

pub fn tool_dir(&self) -> Command

Create a uv tool dir command with options shared across scenarios.

Source

pub fn tool_uninstall(&self) -> Command

Create a uv tool uninstall command with options shared across scenarios.

Source

pub fn add(&self) -> Command

Create a uv add command for the given requirements.

Source

pub fn remove(&self) -> Command

Create a uv remove command for the given requirements.

Source

pub fn tree(&self) -> Command

Create a uv tree command with options shared across scenarios.

Source

pub fn clean(&self) -> Command

Create a uv cache clean command.

Source

pub fn prune(&self) -> Command

Create a uv cache prune command.

Source

pub fn cache_size(&self) -> Command

Create a uv cache size command.

Source

pub fn build_backend(&self) -> Command

Create a uv build_backend command.

Note that this command is hidden and only invoking it through a build frontend is supported.

Source

pub fn interpreter(&self) -> PathBuf

The path to the Python interpreter in the venv.

Don’t use this for Command::new, use Self::python_command instead.

Source

pub fn python_command(&self) -> Command

Source

pub fn auth_login(&self) -> Command

Create a uv auth login command.

Source

pub fn auth_logout(&self) -> Command

Create a uv auth logout command.

Source

pub fn auth_helper(&self) -> Command

Create a uv auth helper --protocol bazel get command.

Source

pub fn auth_token(&self) -> Command

Create a uv auth token command.

Source

pub fn with_real_home(self) -> Self

Set HOME to the real home directory.

We need this for testing commands which use the macOS keychain.

Source

pub fn assert_command(&self, command: &str) -> Assert

Run the given python code and check whether it succeeds.

Source

pub fn assert_file(&self, file: impl AsRef<Path>) -> Assert

Run the given python file and check whether it succeeds.

Source

pub fn assert_installed(&self, package: &'static str, version: &'static str)

Assert a package is installed with the given version.

Source

pub fn assert_not_installed(&self, package: &'static str)

Assert a package is not installed.

Source

pub fn path_patterns(path: impl AsRef<Path>) -> Vec<String>

Generate various escaped regex patterns for the given path.

Source

pub fn python_path(&self) -> OsString

Source

pub fn filters(&self) -> Vec<(&str, &str)>

Standard snapshot filters plus those for this test context.

Source

pub fn filters_without_standard_filters(&self) -> Vec<(&str, &str)>

Only the filters added to this test context.

Source

pub fn python_kind(&self) -> &'static str

For when we add pypy to the test suite.

Source

pub fn site_packages(&self) -> PathBuf

Returns the site-packages folder inside the venv.

Source

pub fn reset_venv(&self)

Reset the virtual environment in the test context.

Source

pub fn copy_ecosystem_project(&self, name: &str)

Copies the files from the ecosystem project given into this text context.

This will almost always write at least a pyproject.toml into this test context.

The given name should correspond to the name of a sub-directory (not a path to it) in the test/ecosystem directory.

This panics (fails the current test) for any failure.

Source

pub fn diff_lock(&self, change: impl Fn(&Self) -> Command) -> String

Creates a way to compare the changes made to a lock file.

This routine starts by copying (not moves) the generated lock file to memory. It then calls the given closure with this test context to get a Command and runs the command. The diff between the old lock file and the new one is then returned.

This assumes that a lock has already been performed.

Source

pub fn read(&self, file: impl AsRef<Path>) -> String

Read a file in the temporary directory

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,