pub struct FileContent { /* private fields */ }Expand description
See content.
Implementations§
Source§impl FileContent
impl FileContent
Sourcepub fn exact(self, expected: impl Into<String>) -> Self
pub fn exact(self, expected: impl Into<String>) -> Self
The whole content must equal this text.
Sourcepub fn contains<I, S>(self, values: I) -> Self
pub fn contains<I, S>(self, values: I) -> Self
The content must contain every one of these substrings.
Sourcepub fn excludes<I, S>(self, values: I) -> Self
pub fn excludes<I, S>(self, values: I) -> Self
The content must contain none of these substrings.
Sourcepub fn strip(self) -> Self
pub fn strip(self) -> Self
Strip surrounding whitespace from the content before comparing (Python’s
str.strip).
Sourcepub fn message(self, message: impl Into<String>) -> Self
pub fn message(self, message: impl Into<String>) -> Self
Shown when the content does not match, instead of
messages::FILE_CONTENT_MISMATCH.
Sourcepub fn missing(self, message: impl Into<String>) -> Self
pub fn missing(self, message: impl Into<String>) -> Self
Shown when the file does not exist, instead of messages::FILE_NOT_EXISTS.
Sourcepub fn unreadable(self, message: impl Into<String>) -> Self
pub fn unreadable(self, message: impl Into<String>) -> Self
Shown when the file cannot be read (permissions, not UTF-8), instead of
messages::FILE_READ_ERROR.
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 (const: unstable) · 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<FileContent> for Requirement
impl From<FileContent> for Requirement
Source§fn from(builder: FileContent) -> Self
fn from(builder: FileContent) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for FileContent
impl RefUnwindSafe for FileContent
impl Send for FileContent
impl Sync for FileContent
impl Unpin for FileContent
impl UnsafeUnpin 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