pub enum FileContent {
Path(PathBuf),
Bytes(Vec<u8>),
}Expand description
Representation of the content of a file to be added into a test environment
FileContent::Path represents a path on the host system. The test runner will copy from
this path into the test environment at test compile time. If the data should be loaded now,
consider using FileContent::Bytes.
FileContent::Bytes contains a vec of bytes that will be written to the file when the tests
are compiled.
Variants§
Path(PathBuf)
Copies a file directly from this path
NOTE: This happens when the tests are compiled. If you want to load the file into
memory first, use FileContent::Bytes.
Bytes(Vec<u8>)
Creates a new file with this content
Implementations§
Source§impl FileContent
impl FileContent
Sourcepub fn path(path: impl Into<PathBuf>) -> Self
pub fn path(path: impl Into<PathBuf>) -> Self
Construct a FileContent::Path from something that’s like a path
let content = FileContent::path("/foo/bar");Trait Implementations§
Source§impl Clone for FileContent
impl Clone for FileContent
Source§fn clone(&self) -> FileContent
fn clone(&self) -> FileContent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileContent
impl Debug for FileContent
Source§impl From<&[u8]> for FileContent
impl From<&[u8]> for FileContent
Source§impl From<&Path> for FileContent
impl From<&Path> for FileContent
Source§impl From<PathBuf> for FileContent
impl From<PathBuf> for FileContent
Source§impl PartialEq for FileContent
impl PartialEq for FileContent
impl Eq for FileContent
impl StructuralPartialEq for FileContent
Auto Trait Implementations§
impl Freeze for FileContent
impl RefUnwindSafe for FileContent
impl Send for FileContent
impl Sync for FileContent
impl Unpin for FileContent
impl UnwindSafe for FileContent
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