pub enum Condition {
FileExists(PathBuf),
FilePattern(String),
CursorInFunction(String),
CursorInStruct(String),
CursorInTest,
HasDependency(String),
InWorkspace,
Platform(String),
Expression(String),
}
Expand description
Conditions that determine when a command is available
Variants§
FileExists(PathBuf)
File must exist
FilePattern(String)
File pattern must match
CursorInFunction(String)
Cursor must be in a function with this name
CursorInStruct(String)
Cursor must be in a struct with this name
CursorInTest
Cursor must be in a test function
HasDependency(String)
Project must have this dependency
InWorkspace
Must be in a workspace
Platform(String)
Must be on a specific platform
Expression(String)
Custom condition with expression
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Condition
impl<'de> Deserialize<'de> for Condition
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 StructuralPartialEq for Condition
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
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