pub struct Rules {
pub openers: Vec<Opener>,
pub rules: Vec<Rule>,
}Expand description
Openers and the rules that pick them. The first rule that matches a
file decides; Rules::prepend puts a rule of your own before the
defaults, as Yazi’s prepend_rules.
Fields§
§openers: Vec<Opener>§rules: Vec<Rule>Implementations§
Source§impl Rules
impl Rules
Sourcepub fn yazi() -> Rules
pub fn yazi() -> Rules
Yazi’s defaults: edit ($EDITOR, blocking), open and play
(the system’s opener), reveal (the file’s folder) and extract;
directories, text, JSON, JavaScript and empty files go to the
editor first, media to play, archives to extract, anything else
to open, each with reveal after it.
Sourcepub fn matching(&self, path: &Path, mime: &str) -> Vec<&Opener>
pub fn matching(&self, path: &Path, mime: &str) -> Vec<&Opener>
The openers for the file at path of type mime (pass
inode/directory for a directory): the first matching rule’s, in
its order, the names it uses that are not openers left out.
The openers every one of files (path and MIME type) can use, in
the first one’s order: what “Open with…” offers for a selection.
Trait Implementations§
impl Eq for Rules
impl StructuralPartialEq for Rules
Auto Trait Implementations§
impl Freeze for Rules
impl RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl UnsafeUnpin for Rules
impl UnwindSafe for Rules
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.