pub struct ContextRule {
pub matches: Vec<ContextMatch>,
pub items: Vec<ContextAction>,
pub include: Option<PathBuf>,
}Expand description
A context-menu rule: rows claimed by any matches entry get exactly
items. Rules are evaluated top-down; the first match wins.
A rule may instead be an include: include = "rules.d" (no matches)
pulls in the [[context_menu.rules]] of every *.toml file in that
directory, spliced in at the include’s position. This lets specific rules
live in their own files yet still be checked before a later catch-all
fallback rule. See [expand_includes].
Fields§
§matches: Vec<ContextMatch>§items: Vec<ContextAction>§include: Option<PathBuf>Directory (relative to the config file, or absolute) whose *.toml
files supply rules to splice in here. Mutually exclusive with matches.
Implementations§
Source§impl ContextRule
impl ContextRule
Sourcepub fn rule(matches: Vec<ContextMatch>, items: Vec<ContextAction>) -> Self
pub fn rule(matches: Vec<ContextMatch>, items: Vec<ContextAction>) -> Self
A plain matching rule.
Trait Implementations§
Source§impl Clone for ContextRule
impl Clone for ContextRule
Source§impl Debug for ContextRule
impl Debug for ContextRule
Source§impl<'de> Deserialize<'de> for ContextRule
impl<'de> Deserialize<'de> for ContextRule
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 ContextRule
Source§impl PartialEq for ContextRule
impl PartialEq for ContextRule
Source§impl Serialize for ContextRule
impl Serialize for ContextRule
impl StructuralPartialEq for ContextRule
Auto Trait Implementations§
impl Freeze for ContextRule
impl RefUnwindSafe for ContextRule
impl Send for ContextRule
impl Sync for ContextRule
impl Unpin for ContextRule
impl UnsafeUnpin for ContextRule
impl UnwindSafe for ContextRule
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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