pub struct ModeStr(/* private fields */);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().
Implementations§
Source§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 = NvimString>§
pub fn as_bytes(&self) -> &[u8] ⓘ
Sourcepub fn as_nvim_str(&self) -> NvimStr<'_>
pub fn as_nvim_str(&self) -> NvimStr<'_>
Returns an NvimStr view of this String.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the length of the String, not including the final null
byte.
Sourcepub 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.
Sourcepub 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§
Source§impl<'de> Deserialize<'de> for ModeStr
impl<'de> Deserialize<'de> for ModeStr
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
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 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,
Source§impl<T> FromObject for T
impl<T> FromObject for T
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§type Error = Infallible
type Error = Infallible
The error type in the returned
Result.Source§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.