pub struct Data { /* private fields */ }
Expand description
Test fixture, actual output, or expected result
This provides conveniences for tracking the intended format (binary vs text).
Implementations§
source§impl Data
impl Data
sourcepub fn read_from(
path: &Path,
data_format: Option<DataFormat>
) -> Result<Self, Error>
pub fn read_from(
path: &Path,
data_format: Option<DataFormat>
) -> Result<Self, Error>
Load test data from a file
sourcepub fn render(&self) -> Option<String>
pub fn render(&self) -> Option<String>
Return the underlying String
Note: this will not inspect binary data for being a valid String
.
pub fn to_bytes(&self) -> Vec<u8>
pub fn try_coerce(self, format: DataFormat) -> Self
sourcepub fn format(&self) -> DataFormat
pub fn format(&self) -> DataFormat
Outputs the current DataFormat
of the underlying data