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 text: String,
pub line: usize,
}Fields§
§path: StringSpecifies 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_libcrate: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:librarynew_source_root:local
library: boolExplicitly 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
text: StringActual file contents. All meta comments are stripped.
line: usizeThe line number in the original fixture of the beginning of this fixture.
Trait Implementations§
impl Eq for Fixture
impl StructuralPartialEq for Fixture
Auto Trait Implementations§
impl Freeze for Fixture
impl RefUnwindSafe for Fixture
impl Send for Fixture
impl Sync for Fixture
impl Unpin for Fixture
impl UnwindSafe for Fixture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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