pub struct Fixture {
    pub path: String,
    pub krate: Option<String>,
    pub deps: Vec<String>,
    pub extern_prelude: Option<Vec<String>>,
    pub cfgs: Vec<(String, Option<String>)>,
    pub edition: Option<String>,
    pub env: FxHashMap<String, String>,
    pub introduce_new_source_root: Option<String>,
    pub library: bool,
    pub target_data_layout: Option<String>,
    pub text: String,
}

Fields§

§path: String

Specifies the path for this file. It must start with “/”.

§krate: Option<String>

Defines a new crate and make this file its root module.

Version and repository URL of the crate can optionally be specified; if either one is specified, the other must also be specified.

Syntax:

  • crate:my_awesome_lib
  • crate:my_awesome_lib@0.0.1,https://example.com/repo.git
§deps: Vec<String>

Specifies dependencies of this crate. This must be used with crate meta.

Syntax: deps:hir-def,ide-assists

§extern_prelude: Option<Vec<String>>

Limits crates in the extern prelude. The set of crate names must be a subset of deps. This must be used with crate meta.

If this is not specified, all the dependencies will be in the extern prelude.

Syntax: extern-prelude:hir-def,ide-assists

§cfgs: Vec<(String, Option<String>)>

Specifies configuration options to be enabled. Options may have associated values.

Syntax: cfg:test,dbg=false,opt_level=2

§edition: Option<String>

Specifies the edition of this crate. This must be used with crate meta. If this is not specified, ([base_db::input::Edition::CURRENT]) will be used. This must be used with crate meta.

Syntax: edition:2021

§env: FxHashMap<String, String>

Specifies environment variables.

Syntax: env:PATH=/bin,RUST_LOG=debug

§introduce_new_source_root: Option<String>

Introduces a new source root. This file and the following files will belong the new source root. This must be used with crate meta.

Use this if you want to test something that uses SourceRoot::is_library() to check editability.

Note that files before the first fixture with new_source_root meta will belong to an implicitly defined local source root.

Syntax:

  • new_source_root:library
  • new_source_root:local
§library: bool

Explicitly declares this crate as a library outside current workspace. This must be used with crate meta.

This is implied if this file belongs to a library source root.

Use this if you want to test something that checks if a crate is a workspace member via CrateOrigin.

Syntax: library

§target_data_layout: Option<String>

Specifies LLVM data layout to be used.

You probably don’t want to manually specify this. See LLVM manual for the syntax, if you must: https://llvm.org/docs/LangRef.html#data-layout

§text: String

Actual file contents. All meta comments are stripped.

Trait Implementations§

source§

impl Debug for Fixture

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Fixture

source§

fn eq(&self, other: &Fixture) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Fixture

source§

impl StructuralEq for Fixture

source§

impl StructuralPartialEq for Fixture

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> 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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoBox<dyn Any> for T
where T: Any,

source§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

source§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
source§

impl<T> IntoBox<dyn Any + Sync + Send> for T
where T: Any + Send + Sync,

source§

fn into_box(self) -> Box<dyn Any + Sync + Send>

Convert self into the appropriate boxed form.
source§

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

§

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>,

§

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.