Struct vimvar::VimVar [−][src]
Expand description
Represents a vim variable to be extracted
Implementations
impl<Name: AsRef<str>> VimVar<Name>
[src]
impl<Name: AsRef<str>> VimVar<Name>
[src]impl<Name: AsRef<str>> VimVar<Name>
[src]
impl<Name: AsRef<str>> VimVar<Name>
[src]pub fn load_typed<T>(&self, allow_zero: bool) -> Result<Option<T>> where
T: DeserializeOwned,
[src]
pub fn load_typed<T>(&self, allow_zero: bool) -> Result<Option<T>> where
T: DeserializeOwned,
[src]Loads variable with Self::load
and then attempts to convert it
to the specified type
Notes
- If
allow_zero
is true, then a value of 0 is considered the value of the variable rather than vim’s default of not being found
pub fn load(&self, allow_zero: bool) -> Result<Option<Value>>
[src]
pub fn load(&self, allow_zero: bool) -> Result<Option<Value>>
[src]Loads the variable’s value using neovim’s headless mode or vim’s ex mode using the default vimrc available in scope
Notes
- Will leverage
utils::find_vimrc
to load in the appropriate vimrc during ex mode - If
allow_zero
is true, then a value of 0 is considered the value of the variable rather than vim’s default of not being found
pub fn load_typed_with_config<P: AsRef<Path>, T>(
&self,
config: P,
allow_zero: bool
) -> Result<Option<T>> where
T: DeserializeOwned,
[src]
pub fn load_typed_with_config<P: AsRef<Path>, T>(
&self,
config: P,
allow_zero: bool
) -> Result<Option<T>> where
T: DeserializeOwned,
[src]Loads variable with Self::load_with_config
and then attempts to
convert it to the specified type
Notes
- If
allow_zero
is true, then a value of 0 is considered the value of the variable rather than vim’s default of not being found
pub fn load_with_config<P: AsRef<Path>>(
&self,
config: P,
allow_zero: bool
) -> Result<Option<Value>>
[src]
pub fn load_with_config<P: AsRef<Path>>(
&self,
config: P,
allow_zero: bool
) -> Result<Option<Value>>
[src]Loads the variable’s value using neovim’s headless mode or vim’s ex mode
Notes
- Spawns a vim process whose goal is to print out the contents of a variable as a JSON string
- Leverages batch & ex modes with redir to execute and capture output
- Relies on the variable being available upon loading vim configs
- If
allow_zero
is true, then a value of 0 is considered the value of the variable rather than vim’s default of not being found
Trait Implementations
impl<Name: Eq + AsRef<str>> Eq for VimVar<Name>
[src]
impl<Name: AsRef<str>> StructuralEq for VimVar<Name>
[src]
impl<Name: AsRef<str>> StructuralPartialEq for VimVar<Name>
[src]
Auto Trait Implementations
impl<Name> RefUnwindSafe for VimVar<Name> where
Name: RefUnwindSafe,
Name: RefUnwindSafe,
impl<Name> Send for VimVar<Name> where
Name: Send,
Name: Send,
impl<Name> Sync for VimVar<Name> where
Name: Sync,
Name: Sync,
impl<Name> Unpin for VimVar<Name> where
Name: Unpin,
Name: Unpin,
impl<Name> UnwindSafe for VimVar<Name> where
Name: UnwindSafe,
Name: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more