pub struct Fixture { /* private fields */ }Expand description
A test fixture containing files and configuration.
Implementations§
Source§impl Fixture
impl Fixture
Sourcepub fn from_tar(data: &[u8]) -> Result<Self, FixtureError>
pub fn from_tar(data: &[u8]) -> Result<Self, FixtureError>
Sourcepub fn from_files(files: Vec<(&str, &[u8])>) -> Self
pub fn from_files(files: Vec<(&str, &[u8])>) -> Self
Create fixture from inline files.
Sourcepub fn manifest(&self) -> &FixtureManifest
pub fn manifest(&self) -> &FixtureManifest
Get the fixture manifest.
Sourcepub fn list_files(&self) -> Vec<&str>
pub fn list_files(&self) -> Vec<&str>
List all file paths in the fixture.
Sourcepub fn get_file_str(&self, path: &str) -> Result<&str, FixtureError>
pub fn get_file_str(&self, path: &str) -> Result<&str, FixtureError>
Get file contents as string.
Sourcepub fn get_app_yaml(&self) -> Result<&str, FixtureError>
pub fn get_app_yaml(&self) -> Result<&str, FixtureError>
Get the app.yaml content if present.
Sourcepub fn get_data(&self, name: &str) -> Result<&[u8], FixtureError>
pub fn get_data(&self, name: &str) -> Result<&[u8], FixtureError>
Get a data file (.ald) content.
Sourcepub fn get_model(&self, name: &str) -> Result<&[u8], FixtureError>
pub fn get_model(&self, name: &str) -> Result<&[u8], FixtureError>
Get a model file (.apr) content.
Sourcepub fn get_snapshot(&self, name: &str) -> Result<&[u8], FixtureError>
pub fn get_snapshot(&self, name: &str) -> Result<&[u8], FixtureError>
Get a snapshot baseline image.
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Get fixture file count.
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
Get total fixture size in bytes.
Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().