#[non_exhaustive]pub struct IgnoreEofConfig {
pub message: String,
}Expand description
Configuration for the EofGuard’s ignore-eof behavior.
When present in Env::any, EofGuard retries reading
on EOF when the ignore-eof option is enabled,
printing message to remind the user.
If absent from env.any, the ignore-eof EOF protection in EofGuard
is disabled.
Store this config in the environment with
env.any.insert(Box::new(config)).
Note that IgnoreEof is not affected by this config.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message: StringText displayed when EOF is ignored due to the ignore-eof option
Implementations§
Source§impl IgnoreEofConfig
impl IgnoreEofConfig
Sourcepub fn with_message<M: Into<String>>(message: M) -> Self
pub fn with_message<M: Into<String>>(message: M) -> Self
Creates a new IgnoreEofConfig with the given message.
Trait Implementations§
Source§impl Clone for IgnoreEofConfig
impl Clone for IgnoreEofConfig
Source§fn clone(&self) -> IgnoreEofConfig
fn clone(&self) -> IgnoreEofConfig
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 IgnoreEofConfig
impl Debug for IgnoreEofConfig
Source§impl Default for IgnoreEofConfig
impl Default for IgnoreEofConfig
Source§fn default() -> IgnoreEofConfig
fn default() -> IgnoreEofConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IgnoreEofConfig
impl RefUnwindSafe for IgnoreEofConfig
impl Send for IgnoreEofConfig
impl Sync for IgnoreEofConfig
impl Unpin for IgnoreEofConfig
impl UnsafeUnpin for IgnoreEofConfig
impl UnwindSafe for IgnoreEofConfig
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 more