Struct ModeStr
pub struct ModeStr(String);Expand description
A newtype around an [NvimString] whose contents are guaranteed to match
the textual representation of one of the modes listed under :help mode().
Tuple Fields§
§0: StringImplementations§
§impl ModeStr
impl ModeStr
pub fn is_select_or_visual(&self) -> bool
pub fn is_select(&self) -> bool
pub fn is_select_blockwise(&self) -> bool
pub fn is_select_by_character(&self) -> bool
pub fn is_select_by_line(&self) -> bool
pub fn is_visual(&self) -> bool
pub fn is_visual_blockwise(&self) -> bool
pub fn is_visual_by_character(&self) -> bool
pub fn is_visual_by_line(&self) -> bool
Methods from Deref<Target = String>§
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_nvim_str(&self) -> NvimStr<'_>
pub fn as_nvim_str(&self) -> NvimStr<'_>
Returns an [NvimStr] view of this String.
pub fn to_str(&self) -> Result<&str, Utf8Error>
pub fn to_str(&self) -> Result<&str, Utf8Error>
Yields a string slice if the [String]’s contents are valid UTF-8.
pub fn to_string_lossy(&self) -> Cow<'_, str>
pub fn to_string_lossy(&self) -> Cow<'_, str>
Converts the String into Rust’s std::string::String. If it already
holds a valid UTF-8 byte sequence no allocation is made. If it doesn’t
the String is copied and all invalid sequences are replaced with �.
Trait Implementations§
§impl<'de> Deserialize<'de> for ModeStr
impl<'de> Deserialize<'de> for ModeStr
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModeStr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModeStr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModeStr
Auto Trait Implementations§
impl Freeze for ModeStr
impl RefUnwindSafe for ModeStr
impl !Send for ModeStr
impl !Sync for ModeStr
impl Unpin for ModeStr
impl UnsafeUnpin for ModeStr
impl UnwindSafe for ModeStr
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> FromObject for Twhere
T: TryFrom<Object, Error = Error>,
impl<T> FromObject for Twhere
T: TryFrom<Object, Error = Error>,
fn from_object(obj: Object) -> Result<T, Error>
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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§type Error = Infallible
type Error = Infallible
The error type in the returned
Result.§fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
Converts the value into a
Result.