Enum harper_core::Suggestion
source · pub enum Suggestion {
ReplaceWith(Vec<char>),
Remove,
}
Variants§
Implementations§
source§impl Suggestion
impl Suggestion
sourcepub const fn is_replace_with(&self) -> bool
pub const fn is_replace_with(&self) -> bool
Returns true
if self
is of variant ReplaceWith
.
sourcepub fn as_replace_with(&self) -> Option<&Vec<char>>
pub fn as_replace_with(&self) -> Option<&Vec<char>>
Returns Some
if self
is a reference of variant ReplaceWith
, and None
otherwise.
sourcepub fn as_mut_replace_with(&mut self) -> Option<&mut Vec<char>>
pub fn as_mut_replace_with(&mut self) -> Option<&mut Vec<char>>
Returns Some
if self
is a mutable reference of variant ReplaceWith
, and None
otherwise.
sourcepub fn expect_replace_with(self) -> Vec<char>where
Self: Debug,
pub fn expect_replace_with(self) -> Vec<char>where
Self: Debug,
Unwraps the value, yielding the content of ReplaceWith
.
§Panics
Panics if the value is not ReplaceWith
, with a panic message including the content of self
.
sourcepub fn replace_with(self) -> Option<Vec<char>>
pub fn replace_with(self) -> Option<Vec<char>>
Returns Some
if self
is of variant ReplaceWith
, and None
otherwise.
Trait Implementations§
source§impl Clone for Suggestion
impl Clone for Suggestion
source§fn clone(&self) -> Suggestion
fn clone(&self) -> Suggestion
Returns a copy 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 Suggestion
impl Debug for Suggestion
source§impl<'de> Deserialize<'de> for Suggestion
impl<'de> Deserialize<'de> for Suggestion
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Suggestion
impl Display for Suggestion
Auto Trait Implementations§
impl Freeze for Suggestion
impl RefUnwindSafe for Suggestion
impl Send for Suggestion
impl Sync for Suggestion
impl Unpin for Suggestion
impl UnwindSafe for Suggestion
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> 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