dir_bench/lib.rs
1#![feature(test)]
2pub struct Fixture<T> {
3 content: T,
4 path: &'static str,
5}
6
7impl<T> Fixture<T> {
8 #[doc(hidden)]
9 /// Creates a new fixture from the given content and path.
10 pub fn new(content: T, path: &'static str) -> Self {
11 Self { content, path }
12 }
13
14 /// Returns a reference to the content of the fixture.
15 pub fn content(&self) -> &T {
16 &self.content
17 }
18
19 /// Consumes the fixture and returns the content.
20 pub fn into_content(self) -> T {
21 self.content
22 }
23
24 /// Returns the absolute path of the fixture.
25 pub const fn path(&self) -> &'static str {
26 self.path
27 }
28}
29
30pub use dir_bench_macros::*;