repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/plugin/preloader.rs | yazi-config/src/plugin/preloader.rs | use serde::Deserialize;
use yazi_fs::File;
use yazi_shared::event::Cmd;
use crate::{Pattern, Priority};
#[derive(Debug, Deserialize)]
pub struct Preloader {
#[serde(skip)]
pub idx: u8,
pub url: Option<Pattern>,
pub mime: Option<Pattern>,
pub run: Cmd,
#[serde(default)]
pub next: bool,
#[serde(default)]
pu... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/plugin/spotter.rs | yazi-config/src/plugin/spotter.rs | use serde::Deserialize;
use yazi_fs::File;
use yazi_shared::event::Cmd;
use crate::Pattern;
#[derive(Debug, Deserialize)]
pub struct Spotter {
pub url: Option<Pattern>,
pub mime: Option<Pattern>,
pub run: Cmd,
}
impl Spotter {
#[inline]
pub fn matches(&self, file: &File, mime: &str) -> bool {
self.mime.as_r... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/plugin/plugin.rs | yazi-config/src/plugin/plugin.rs | use anyhow::Result;
use hashbrown::HashSet;
use serde::Deserialize;
use tracing::warn;
use yazi_codegen::DeserializeOver2;
use yazi_fs::File;
use super::{Fetcher, Preloader, Previewer, Spotter};
use crate::{Preset, plugin::MAX_PREWORKERS};
#[derive(Default, Deserialize, DeserializeOver2)]
pub struct Plugin {
pub fet... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/preview/mod.rs | yazi-config/src/preview/mod.rs | yazi_macro::mod_flat!(preview wrap);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/preview/wrap.rs | yazi-config/src/preview/wrap.rs | use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum PreviewWrap {
No,
Yes,
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/preview/preview.rs | yazi-config/src/preview/preview.rs | use std::{borrow::Cow, path::PathBuf};
use anyhow::{Context, Result, bail};
use serde::{Deserialize, Serialize};
use yazi_codegen::DeserializeOver2;
use yazi_fs::Xdg;
use yazi_shared::{SStr, timestamp_us};
use super::PreviewWrap;
use crate::normalize_path;
#[rustfmt::skip]
const TABS: &[&str] = &["", " ", " ", " ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/mgr/mgr.rs | yazi-config/src/mgr/mgr.rs | use anyhow::{Result, bail};
use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use yazi_fs::{CWD, SortBy};
use yazi_shared::{SyncCell, url::UrlLike};
use super::{MgrRatio, MouseEvents};
#[derive(Debug, Deserialize, DeserializeOver2)]
pub struct Mgr {
pub ratio: SyncCell<MgrRatio>,
// Sorting
pub sort_by:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/mgr/mouse.rs | yazi-config/src/mgr/mouse.rs | use anyhow::{Result, bail};
use bitflags::bitflags;
use crossterm::event::MouseEventKind;
use serde::{Deserialize, Serialize};
bitflags! {
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(try_from = "Vec<String>", into = "Vec<String>")]
pub struct MouseEvents: u8 {
const CLICK... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/mgr/mod.rs | yazi-config/src/mgr/mod.rs | yazi_macro::mod_flat!(mgr mouse ratio);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/mgr/ratio.rs | yazi-config/src/mgr/ratio.rs | use anyhow::bail;
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(try_from = "[u16; 3]")]
pub struct MgrRatio {
pub parent: u16,
pub current: u16,
pub preview: u16,
pub all: u16,
}
impl TryFrom<[u16; 3]> for MgrRatio {
type Error = a... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/offset.rs | yazi-config/src/popup/offset.rs | use anyhow::bail;
use serde::Deserialize;
#[derive(Clone, Copy, Debug, Default, Deserialize)]
#[serde(try_from = "[i16; 4]")]
pub struct Offset {
pub x: i16,
pub y: i16,
pub width: u16,
pub height: u16,
}
impl TryFrom<[i16; 4]> for Offset {
type Error = anyhow::Error;
fn try_from(values: [i16; 4]) -... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/pick.rs | yazi-config/src/popup/pick.rs | use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use super::{Offset, Origin};
#[derive(Deserialize, DeserializeOver2)]
pub struct Pick {
// open
pub open_title: String,
pub open_origin: Origin,
pub open_offset: Offset,
}
impl Pick {
pub const fn border(&self) -> u16 { 2 }
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/options.rs | yazi-config/src/popup/options.rs | use ratatui::{text::{Line, Text}, widgets::{Paragraph, Wrap}};
use yazi_shared::{scheme::Encode as EncodeScheme, strand::ToStrand, url::{Url, UrlBuf}};
use super::{Offset, Position};
use crate::YAZI;
#[derive(Debug, Default)]
pub struct InputCfg {
pub title: String,
pub value: String,
pub cursor: Opt... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/mod.rs | yazi-config/src/popup/mod.rs | yazi_macro::mod_flat!(confirm input offset options origin pick position);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/origin.rs | yazi-config/src/popup/origin.rs | use std::{fmt::Display, str::FromStr};
use serde::Deserialize;
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "kebab-case")]
pub enum Origin {
#[default]
TopLeft,
TopCenter,
TopRight,
BottomLeft,
BottomCenter,
BottomRight,
Center,
Hovered,
}
impl Display for Origin... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/position.rs | yazi-config/src/popup/position.rs | use crossterm::terminal::WindowSize;
use ratatui::layout::Rect;
use super::{Offset, Origin};
#[derive(Clone, Copy, Debug, Default)]
pub struct Position {
pub origin: Origin,
pub offset: Offset,
}
impl Position {
pub const fn new(origin: Origin, offset: Offset) -> Self { Self { origin, offset } }
pub fn rect(&se... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/confirm.rs | yazi-config/src/popup/confirm.rs | use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use super::{Offset, Origin};
use crate::popup::Position;
#[derive(Deserialize, DeserializeOver2)]
pub struct Confirm {
// trash
pub trash_title: String,
pub trash_origin: Origin,
pub trash_offset: Offset,
// delete
pub delete_title: String,
pub del... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/popup/input.rs | yazi-config/src/popup/input.rs | use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use super::{Offset, Origin};
#[derive(Deserialize, DeserializeOver2)]
pub struct Input {
pub cursor_blink: bool,
// cd
pub cd_title: String,
pub cd_origin: Origin,
pub cd_offset: Offset,
// create
pub create_title: [String; 2],
pub create_origin:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/key.rs | yazi-config/src/keymap/key.rs | use std::{fmt::{Display, Write}, str::FromStr};
use anyhow::bail;
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct Key {
pub code: KeyCode,
pub shift: bool,
pub ctrl: bool,
pub alt: bool,
pub super_: bool,
}
impl Key {
#[inline]
pub... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/deserializers.rs | yazi-config/src/keymap/deserializers.rs | use std::{fmt, str::FromStr};
use anyhow::Result;
use serde::{Deserializer, de::{self, Visitor}};
use yazi_shared::event::Cmd;
use crate::keymap::Key;
pub(super) fn deserialize_on<'de, D>(deserializer: D) -> Result<Vec<Key>, D::Error>
where
D: Deserializer<'de>,
{
struct OnVisitor;
impl<'de> Visitor<'de> for OnV... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/mod.rs | yazi-config/src/keymap/mod.rs | yazi_macro::mod_flat!(chord cow deserializers key keymap rules);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/chord.rs | yazi-config/src/keymap/chord.rs | use std::{borrow::Cow, hash::{Hash, Hasher}, sync::OnceLock};
use anyhow::Result;
use regex::Regex;
use serde::Deserialize;
use yazi_shared::{Layer, Source, event::Cmd};
use super::Key;
static RE: OnceLock<Regex> = OnceLock::new();
#[derive(Debug, Default, Deserialize)]
pub struct Chord {
#[serde(deserialize_with ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/keymap.rs | yazi-config/src/keymap/keymap.rs | use anyhow::{Context, Result};
use serde::Deserialize;
use yazi_codegen::DeserializeOver1;
use yazi_fs::{Xdg, ok_or_not_found};
use yazi_shared::Layer;
use super::{Chord, KeymapRules};
#[derive(Deserialize, DeserializeOver1)]
pub struct Keymap {
pub mgr: KeymapRules,
pub tasks: KeymapRules,
pub spot: Keym... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/cow.rs | yazi-config/src/keymap/cow.rs | use std::ops::Deref;
use yazi_shared::event::CmdCow;
use super::Chord;
#[derive(Debug)]
pub enum ChordCow {
Owned(Chord),
Borrowed(&'static Chord),
}
impl From<Chord> for ChordCow {
fn from(c: Chord) -> Self { Self::Owned(c) }
}
impl From<&'static Chord> for ChordCow {
fn from(c: &'static Chord) -> Self { Self... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/keymap/rules.rs | yazi-config/src/keymap/rules.rs | use std::ops::Deref;
use anyhow::Result;
use hashbrown::HashSet;
use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use yazi_shared::Layer;
use super::Chord;
use crate::{Preset, check_for, keymap::Key};
#[derive(Default, Deserialize, DeserializeOver2)]
pub struct KeymapRules {
pub keymap: Vec<Chord>,
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/theme/icon.rs | yazi-config/src/theme/icon.rs | use std::ops::Deref;
use anyhow::Result;
use hashbrown::HashMap;
use ratatui::style::Color;
use serde::{Deserialize, Deserializer};
use yazi_codegen::DeserializeOver2;
use yazi_fs::File;
use yazi_shared::{Condition, url::UrlLike};
use crate::{Icon as I, Pattern, Style};
#[derive(Default, Deserialize, DeserializeOver... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/theme/flavor.rs | yazi-config/src/theme/flavor.rs | use std::path::PathBuf;
use anyhow::{Context, Result};
use serde::{Deserialize, Serialize};
use toml::Value;
use yazi_codegen::DeserializeOver2;
use yazi_fs::Xdg;
#[derive(Default, Deserialize, DeserializeOver2, Serialize)]
pub struct Flavor {
pub dark: String,
pub light: String,
}
impl From<&Value> for Flavor {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/theme/theme.rs | yazi-config/src/theme/theme.rs | use std::path::PathBuf;
use anyhow::{Context, Result, anyhow, bail};
use serde::Deserialize;
use yazi_codegen::{DeserializeOver1, DeserializeOver2};
use yazi_fs::{Xdg, ok_or_not_found};
use super::{Filetype, Flavor, Icon};
use crate::{Style, normalize_path};
#[derive(Deserialize, DeserializeOver1)]
pub struct Theme ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/theme/filetype.rs | yazi-config/src/theme/filetype.rs | use std::ops::Deref;
use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use yazi_fs::File;
use super::Is;
use crate::{Pattern, Style};
#[derive(Deserialize, DeserializeOver2)]
pub struct Filetype {
rules: Vec<FiletypeRule>,
}
impl Deref for Filetype {
type Target = Vec<FiletypeRule>;
fn deref(&self) ->... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/theme/mod.rs | yazi-config/src/theme/mod.rs | yazi_macro::mod_flat!(filetype flavor icon is theme);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/theme/is.rs | yazi-config/src/theme/is.rs | use serde::Deserialize;
use yazi_fs::cha::Cha;
#[derive(Default, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Is {
#[default]
None,
Hidden,
Link,
Orphan,
Dummy,
Block,
Char,
Fifo,
Sock,
Exec,
Sticky,
}
impl Is {
pub fn check(&self, cha: &Cha) -> bool {
match self {
Self::None => true,
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/which/sorting.rs | yazi-config/src/which/sorting.rs | use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum SortBy {
#[default]
None,
Key,
Desc,
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/which/which.rs | yazi-config/src/which/which.rs | use serde::{Deserialize, Serialize};
use yazi_codegen::DeserializeOver2;
use super::SortBy;
#[derive(Debug, Deserialize, DeserializeOver2, Serialize)]
pub struct Which {
// Sorting
pub sort_by: SortBy,
pub sort_sensitive: bool,
pub sort_reverse: bool,
pub sort_translit: bool,
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/which/mod.rs | yazi-config/src/which/mod.rs | yazi_macro::mod_flat!(sorting which);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/vfs/services.rs | yazi-config/src/vfs/services.rs | use std::ops::Deref;
use anyhow::{Result, bail};
use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
use crate::vfs::Service;
#[derive(Deserialize, Serialize)]
pub struct Services(HashMap<String, Service>);
impl Deref for Services {
type Target = HashMap<String, Service>;
fn deref(&self) -> &Self::Targe... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/vfs/service.rs | yazi-config/src/vfs/service.rs | use std::{io, mem, path::PathBuf};
use serde::{Deserialize, Serialize};
use crate::normalize_path;
#[derive(Deserialize, Serialize)]
#[serde(tag = "type", rename_all = "kebab-case")]
pub enum Service {
Sftp(ServiceSftp),
}
impl TryFrom<&'static Service> for &'static ServiceSftp {
type Error = &'static str;
fn t... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/vfs/mod.rs | yazi-config/src/vfs/mod.rs | yazi_macro::mod_flat!(service services vfs);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/vfs/vfs.rs | yazi-config/src/vfs/vfs.rs | use std::io;
use anyhow::{Context, Result};
use serde::{Deserialize, Serialize};
use tokio::sync::OnceCell;
use yazi_codegen::DeserializeOver1;
use yazi_fs::{Xdg, ok_or_not_found};
use super::Service;
use crate::{Preset, vfs::Services};
#[derive(Deserialize, Serialize, DeserializeOver1)]
pub struct Vfs {
pub servic... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/open/open.rs | yazi-config/src/open/open.rs | use std::ops::Deref;
use anyhow::Result;
use indexmap::IndexSet;
use serde::Deserialize;
use yazi_codegen::DeserializeOver2;
use yazi_shared::url::AsUrl;
use crate::{Preset, open::OpenRule};
#[derive(Default, Deserialize, DeserializeOver2)]
pub struct Open {
rules: Vec<OpenRule>,
#[serde(default)]
prepend... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/open/mod.rs | yazi-config/src/open/mod.rs | yazi_macro::mod_flat!(open rule);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-config/src/open/rule.rs | yazi-config/src/open/rule.rs | use std::fmt;
use serde::{Deserialize, Deserializer, de::{self, Visitor}};
use crate::pattern::Pattern;
#[derive(Debug, Deserialize)]
pub struct OpenRule {
pub url: Option<Pattern>,
pub mime: Option<Pattern>,
#[serde(deserialize_with = "OpenRule::deserialize")]
pub r#use: Vec<String>,
}
impl OpenRule {
#[in... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/event.rs | yazi-macro/src/event.rs | #[macro_export]
macro_rules! emit {
(Quit($opt:expr)) => {
yazi_shared::event::Event::Quit($opt).emit();
};
(Call($cmd:expr)) => {
yazi_shared::event::Event::Call(yazi_shared::event::CmdCow::from($cmd)).emit();
};
(Seq($cmds:expr)) => {
yazi_shared::event::Event::Seq($cmds).emit();
};
($event:ident) => {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/lib.rs | yazi-macro/src/lib.rs | mod actor;
mod asset;
mod context;
mod event;
mod fmt;
mod fs;
mod log;
mod module;
mod platform;
mod render;
mod stdio;
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/stdio.rs | yazi-macro/src/stdio.rs | #[macro_export]
macro_rules! outln {
($($tt:tt)*) => {{
use std::io::Write;
writeln!(std::io::stdout(), $($tt)*)
}}
}
#[macro_export]
macro_rules! errln {
($($tt:tt)*) => {{
use std::io::Write;
writeln!(std::io::stderr(), $($tt)*)
}}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/module.rs | yazi-macro/src/module.rs | #[macro_export]
macro_rules! mod_pub {
[ $( $name:ident $(,)? )+ ] => {
$(
pub mod $name;
)+
};
}
#[macro_export]
macro_rules! mod_flat {
[ $( $name:ident $(,)? )+ ] => {
$(
mod $name;
pub use $name::*;
)+
};
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/fs.rs | yazi-macro/src/fs.rs | #[macro_export]
macro_rules! ok_or_not_found {
($result:expr, $not_found:expr) => {
match $result {
Ok(v) => v,
Err(e) if e.kind() == std::io::ErrorKind::NotFound => $not_found,
Err(e) => Err(e)?,
}
};
($result:expr) => {
ok_or_not_found!($result, Default::default())
};
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/actor.rs | yazi-macro/src/actor.rs | #[macro_export]
macro_rules! act {
(@pre $layer:ident : $name:ident, $cx:ident, $opt:ident) => {
if let Some(hook) = <act!($layer:$name) as yazi_actor::Actor>::hook($cx, &$opt) {
<act!(core:preflight)>::act($cx, (hook, yazi_dds::spark!($layer:$name, $opt))).map(|spark| spark.try_into().unwrap())
} else {
Ok(... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/platform.rs | yazi-macro/src/platform.rs | #[macro_export]
macro_rules! unix_either {
($a:expr, $b:expr) => {{
#[cfg(unix)]
{
$a
}
#[cfg(not(unix))]
{
$b
}
}};
}
#[macro_export]
macro_rules! win_either {
($a:expr, $b:expr) => {{
#[cfg(windows)]
{
$a
}
#[cfg(not(windows))]
{
$b
}
}};
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/asset.rs | yazi-macro/src/asset.rs | #[macro_export]
macro_rules! config_preset {
($name:literal) => {{
#[cfg(debug_assertions)]
{
std::borrow::Cow::from(
std::fs::read_to_string(concat!(
env!("CARGO_MANIFEST_DIR"),
"/preset/",
$name,
"-default.toml"
))
.expect(concat!("Failed to read 'yazi-config/preset/", $name, "... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/log.rs | yazi-macro/src/log.rs | #[macro_export]
macro_rules! time {
($expr:expr) => {
$crate::time!(stringify!($expr), $expr)
};
($label:expr, $expr:expr) => {
$crate::time!($expr, "{}", $label)
};
($expr:expr, $fmt:expr, $($args:tt)*) => {{
if tracing::enabled!(tracing::Level::DEBUG) {
let start = std::time::Instant::now();
let resu... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/render.rs | yazi-macro/src/render.rs | #[macro_export]
macro_rules! render {
() => {
yazi_shared::event::NEED_RENDER.store(true, std::sync::atomic::Ordering::Relaxed);
};
($cond:expr) => {
if $cond {
render!();
}
};
($left:expr, > $right:expr) => {{
let val = $left;
if val > $right {
render!();
}
val
}};
}
#[macro_export]
macro_ru... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/context.rs | yazi-macro/src/context.rs | #[macro_export]
macro_rules! tab {
($cx:ident) => {{
let tab = $cx.tab;
&mut $cx.core.mgr.tabs.items[tab]
}};
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-macro/src/fmt.rs | yazi-macro/src/fmt.rs | #[macro_export]
macro_rules! try_format {
($($arg:tt)*) => {{
use std::fmt::Write;
let mut output = String::new();
output.write_fmt(format_args!($($arg)*)).map(|_| output)
}}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/lib.rs | yazi-watcher/src/lib.rs | yazi_macro::mod_pub!(local remote);
yazi_macro::mod_flat!(backend reporter watched watcher);
pub static WATCHED: yazi_shared::RoCell<parking_lot::RwLock<Watched>> = yazi_shared::RoCell::new();
pub static WATCHER: yazi_shared::RoCell<tokio::sync::Semaphore> = yazi_shared::RoCell::new();
pub fn init() {
WATCHED.with(... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/watched.rs | yazi-watcher/src/watched.rs | use std::path::Path;
use hashbrown::HashSet;
use percent_encoding::percent_decode_str;
use yazi_fs::{Xdg, path::PercentEncoding};
use yazi_shared::{path::{Component, PathBufDyn, PathDyn, PathLike}, pool::InternStr, scheme::SchemeKind, url::{AsUrl, UrlBuf, UrlLike}};
#[derive(Debug, Default)]
pub struct Watched(HashSe... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/backend.rs | yazi-watcher/src/backend.rs | use anyhow::Result;
use tokio::sync::mpsc;
use yazi_shared::url::AsUrl;
use crate::{Reporter, WATCHED, local::{self, LINKED, Linked}, remote};
pub(crate) struct Backend {
local: local::Local,
remote: remote::Remote,
pub(super) reporter: Reporter,
}
impl Backend {
pub(crate) fn serve() ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/watcher.rs | yazi-watcher/src/watcher.rs | use hashbrown::HashSet;
use tokio::sync::watch;
use tracing::error;
use yazi_fs::FsUrl;
use yazi_shared::url::{UrlBuf, UrlCow, UrlLike};
use crate::{Reporter, WATCHED, backend::Backend};
pub struct Watcher {
tx: watch::Sender<HashSet<UrlBuf>>,
reporter: Reporter,
}
impl Watcher {
pub fn serve() -> Self {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/reporter.rs | yazi-watcher/src/reporter.rs | use std::borrow::Cow;
use percent_encoding::percent_decode;
use tokio::sync::mpsc;
use yazi_shared::{scheme::SchemeKind, url::{AsUrl, Url, UrlBuf, UrlCow, UrlLike}};
use crate::{WATCHED, local::LINKED};
#[derive(Clone)]
pub(crate) struct Reporter {
pub(super) local_tx: mpsc::UnboundedSender<UrlBuf>,
pub(super) re... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/remote/remote.rs | yazi-watcher/src/remote/remote.rs | use std::time::{Duration, SystemTime};
use anyhow::Result;
use hashbrown::HashSet;
use tokio::{pin, sync::mpsc::UnboundedReceiver};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use yazi_fs::{File, FilesOp};
use yazi_proxy::MgrProxy;
use yazi_shared::url::{Url, UrlBuf, UrlLike};
use yazi_vfs::VfsFi... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/remote/mod.rs | yazi-watcher/src/remote/mod.rs | yazi_macro::mod_flat!(remote);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/local/local.rs | yazi-watcher/src/local/local.rs | use std::{path::Path, time::Duration};
use anyhow::Result;
use hashbrown::HashSet;
use notify::{PollWatcher, RecommendedWatcher, RecursiveMode, Watcher};
use tokio::{pin, sync::mpsc::{self, UnboundedReceiver}};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use tracing::error;
use yazi_fs::{File, Fi... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/local/linked.rs | yazi-watcher/src/local/linked.rs | use std::{iter, ops::{Deref, DerefMut}, path::{Path, PathBuf}};
use hashbrown::HashMap;
use parking_lot::RwLock;
use yazi_shared::url::Url;
use crate::Watched;
#[derive(Default)]
pub struct Linked(HashMap<PathBuf, PathBuf> /* from ==> to */);
impl Deref for Linked {
type Target = HashMap<PathBuf, PathBuf>;
fn de... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-watcher/src/local/mod.rs | yazi-watcher/src/local/mod.rs | yazi_macro::mod_flat!(linked local);
pub static LINKED: yazi_shared::RoCell<parking_lot::RwLock<Linked>> = yazi_shared::RoCell::new();
pub(super) fn init() { LINKED.with(<_>::default); }
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/build.rs | yazi-boot/build.rs | #[path = "src/args.rs"]
mod args;
use std::{env, error::Error};
use clap::CommandFactory;
use clap_complete::{Shell, generate_to};
use vergen_gitcl::{BuildBuilder, Emitter, GitclBuilder, RustcBuilder};
fn main() -> Result<(), Box<dyn Error>> {
Emitter::default()
.add_instructions(&BuildBuilder::default().build_da... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/lib.rs | yazi-boot/src/lib.rs | yazi_macro::mod_pub!(actions);
yazi_macro::mod_flat!(args boot);
use clap::Parser;
use yazi_shared::RoCell;
pub static ARGS: RoCell<Args> = RoCell::new();
pub static BOOT: RoCell<Boot> = RoCell::new();
pub fn init() {
ARGS.with(<_>::parse);
BOOT.init(<_>::from(&*ARGS));
actions::Actions::act(&ARGS);
}
pub fn i... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/args.rs | yazi-boot/src/args.rs | use std::path::PathBuf;
use clap::Parser;
use yazi_shared::{Id, url::UrlBuf};
#[derive(Debug, Default, Parser)]
#[command(name = "yazi")]
pub struct Args {
/// Set the current working entry
#[arg(index = 1, num_args = 1..=9)]
pub entries: Vec<UrlBuf>,
/// Write the cwd on exit to this file
#[arg(long)]
pub cwd... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/boot.rs | yazi-boot/src/boot.rs | use std::path::PathBuf;
use futures::executor::block_on;
use hashbrown::HashSet;
use yazi_fs::{CWD, Xdg, path::clean_url};
use yazi_shared::{strand::StrandBuf, url::{UrlBuf, UrlLike}};
use yazi_vfs::provider;
#[derive(Debug, Default)]
pub struct Boot {
pub cwds: Vec<UrlBuf>,
pub files: Vec<StrandBuf>,
pub local_... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/rustc.rs | yazi-boot/src/actions/rustc.rs | use super::Actions;
impl Actions {
pub(super) fn rustc() -> String {
format!(
"{} ({} {})",
env!("VERGEN_RUSTC_SEMVER"),
&env!("VERGEN_RUSTC_COMMIT_HASH")[..8],
env!("VERGEN_RUSTC_COMMIT_DATE")
)
}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/triple.rs | yazi-boot/src/actions/triple.rs | use super::Actions;
impl Actions {
pub(super) fn triple() -> String {
format!(
"{} ({}-{})",
env!("VERGEN_RUSTC_HOST_TRIPLE"),
std::env::consts::OS,
std::env::consts::ARCH
)
}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/version.rs | yazi-boot/src/actions/version.rs | use super::Actions;
impl Actions {
pub fn version() -> &'static str {
concat!(
env!("CARGO_PKG_VERSION"),
" (",
env!("VERGEN_GIT_SHA"),
" ",
env!("VERGEN_BUILD_DATE"),
")"
)
}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/clear_cache.rs | yazi-boot/src/actions/clear_cache.rs | use yazi_config::YAZI;
use yazi_fs::Xdg;
use super::Actions;
impl Actions {
pub(super) fn clear_cache() {
if YAZI.preview.cache_dir == *Xdg::cache_dir() {
println!("Clearing cache directory: \n{:?}", YAZI.preview.cache_dir);
std::fs::remove_dir_all(&YAZI.preview.cache_dir).unwrap();
} else {
println!(
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/debug.rs | yazi-boot/src/actions/debug.rs | use std::{env, ffi::OsStr, fmt::Write, path::Path};
use regex::Regex;
use yazi_adapter::Mux;
use yazi_config::{THEME, YAZI};
use yazi_fs::Xdg;
use yazi_shared::timestamp_us;
use super::Actions;
impl Actions {
pub(super) fn debug() -> Result<String, std::fmt::Error> {
let mut s = String::new();
writeln!(s, "\nYa... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/mod.rs | yazi-boot/src/actions/mod.rs | yazi_macro::mod_flat!(actions clear_cache debug rustc triple version);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-boot/src/actions/actions.rs | yazi-boot/src/actions/actions.rs | use std::process;
pub struct Actions;
impl Actions {
pub(crate) fn act(args: &crate::Args) {
if args.debug {
println!("{}", Self::debug().unwrap());
process::exit(0);
}
if args.version {
println!("Yazi {}", Self::version());
process::exit(0);
}
if args.clear_cache {
Self::clear_cache();
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/build.rs | yazi-dds/build.rs | use std::error::Error;
use vergen_gitcl::{Emitter, GitclBuilder};
fn main() -> Result<(), Box<dyn Error>> {
Emitter::default()
.add_instructions(&GitclBuilder::default().commit_date(true).sha(true).build()?)?
.emit()?;
Ok(())
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/stream.rs | yazi-dds/src/stream.rs | use tokio::io::{BufReader, Lines, ReadHalf, WriteHalf};
pub(super) struct Stream;
use tokio::io::AsyncBufReadExt;
#[cfg(unix)]
pub(super) type ClientReader = Lines<BufReader<ReadHalf<tokio::net::UnixStream>>>;
#[cfg(not(unix))]
pub(super) type ClientReader = Lines<BufReader<ReadHalf<tokio::net::TcpStream>>>;
#[cfg(... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/lib.rs | yazi-dds/src/lib.rs | mod macros;
yazi_macro::mod_pub!(ember spark);
yazi_macro::mod_flat!(client payload pubsub pump sendable server state stream);
pub fn init() {
let (tx, rx) = tokio::sync::mpsc::unbounded_channel();
// Client
ID.init(yazi_boot::ARGS.client_id.unwrap_or(yazi_shared::Id::unique()));
PEERS.with(<_>::default);
QUEU... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/state.rs | yazi-dds/src/state.rs | use std::{mem, ops::Deref, sync::atomic::{AtomicU64, Ordering}};
use anyhow::Result;
use hashbrown::HashMap;
use parking_lot::RwLock;
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader, BufWriter};
use yazi_boot::BOOT;
use yazi_fs::provider::{FileBuilder, Provider, local::{Gate, Local}};
use yazi_shared::{RoCel... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/client.rs | yazi-dds/src/client.rs | use std::{iter, mem, str::FromStr};
use anyhow::{Context, Result, bail};
use hashbrown::{HashMap, HashSet};
use parking_lot::RwLock;
use serde::{Deserialize, Serialize};
use tokio::{io::AsyncWriteExt, select, sync::mpsc, task::JoinHandle, time};
use tracing::error;
use yazi_macro::try_format;
use yazi_shared::{Id, RoC... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/pubsub.rs | yazi-dds/src/pubsub.rs | use anyhow::Result;
use hashbrown::{HashMap, HashSet};
use mlua::Function;
use parking_lot::RwLock;
use yazi_boot::BOOT;
use yazi_fs::FolderStage;
use yazi_shared::{Id, RoCell, url::{Url, UrlBuf, UrlBufCov}};
use crate::{Client, ID, PEERS, ember::{BodyDuplicateItem, BodyMoveItem, Ember, EmberBulk, EmberHi}};
pub stat... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/macros.rs | yazi-dds/src/macros.rs | #[macro_export]
macro_rules! spark {
(mgr: $name:ident, $body:expr) => {
paste::paste! {
$crate::spark::Spark::[<$name:camel>]($body)
}
};
($layer:ident : $name:ident, $body:expr) => {
paste::paste! {
$crate::spark::Spark::[<$layer:camel $name:camel>]($body.into())
}
};
}
#[macro_export]
macro_rules!... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/payload.rs | yazi-dds/src/payload.rs | use std::{fmt::Display, io::Write, str::FromStr};
use anyhow::{Result, anyhow};
use yazi_boot::BOOT;
use yazi_macro::{emit, relay};
use yazi_shared::Id;
use crate::{ID, ember::Ember};
#[derive(Debug)]
pub struct Payload<'a> {
pub receiver: Id,
pub sender: Id,
pub body: Ember<'a>,
}
impl<'a> Payload<'a> {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/pump.rs | yazi-dds/src/pump.rs | use std::time::Duration;
use tokio::{pin, select, sync::mpsc};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use yazi_macro::err;
use yazi_shared::{RoCell, url::UrlBuf};
use crate::{Pubsub, ember::{BodyDuplicateItem, BodyMoveItem}};
static DUPLICATE_TX: RoCell<mpsc::UnboundedSender<BodyDuplicateI... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/server.rs | yazi-dds/src/server.rs | use std::{str::FromStr, time::Duration};
use anyhow::Result;
use hashbrown::HashMap;
use parking_lot::RwLock;
use tokio::{io::{AsyncBufReadExt, AsyncWriteExt, BufReader}, select, sync::mpsc::{self, UnboundedReceiver}, task::JoinHandle, time};
use yazi_macro::try_format;
use yazi_shared::{Id, RoCell};
use crate::{Clie... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/sendable.rs | yazi-dds/src/sendable.rs | use std::{any::TypeId, borrow::Cow};
use hashbrown::HashMap;
use mlua::{ExternalError, IntoLua, Lua, MultiValue, Table, Value};
use ordered_float::OrderedFloat;
use yazi_shared::{data::{Data, DataKey}, replace_cow};
pub struct Sendable;
impl Sendable {
pub fn value_to_data(lua: &Lua, value: Value) -> mlua::Result<D... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/spark/spark.rs | yazi-dds/src/spark/spark.rs | use mlua::{FromLua, IntoLua, Lua, Value};
use crate::{spark::SparkKind, try_from_spark};
#[derive(Debug)]
pub enum Spark<'a> {
// Void
Void(yazi_parser::VoidOpt),
// Mgr
Arrow(yazi_parser::ArrowOpt),
Back(yazi_parser::VoidOpt),
BulkRename(yazi_parser::VoidOpt),
Cd(yazi_parser::mgr::CdOpt),
Close(yazi_parser:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/spark/kind.rs | yazi-dds/src/spark/kind.rs | use std::fmt::Display;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum SparkKind {
// Sort
KeySort,
IndSort,
// Stash
IndStash,
RelayStash,
// Quit
KeyQuit,
}
impl AsRef<str> for SparkKind {
fn as_ref(&self) -> &str {
match self {
// Sort
Self::KeySort => "key-sort",
Self::IndSort => "ind-so... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/spark/mod.rs | yazi-dds/src/spark/mod.rs | yazi_macro::mod_flat!(kind spark);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/bulk.rs | yazi-dds/src/ember/bulk.rs | use hashbrown::HashMap;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::url::{Url, UrlCow};
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberBulk<'a> {
pub changes: HashMap<UrlCow<'a>, UrlCow<'a>>,
}
impl<'a> EmberBulk<'a> {
pub fn borrowed<I>(change... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/move.rs | yazi-dds/src/ember/move.rs | use std::borrow::Cow;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::url::UrlBuf;
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberMove<'a> {
pub items: Cow<'a, Vec<BodyMoveItem>>,
}
impl<'a> EmberMove<'a> {
pub fn borrowed(items: &'a Vec<BodyMoveI... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/ember.rs | yazi-dds/src/ember/ember.rs | use anyhow::{Result, bail};
use mlua::{ExternalResult, IntoLua, Lua, Value};
use yazi_shared::Id;
use super::{EmberBulk, EmberBye, EmberCd, EmberCustom, EmberDelete, EmberDuplicate, EmberHey, EmberHi, EmberHover, EmberLoad, EmberMount, EmberMove, EmberRename, EmberTab, EmberTrash, EmberYank};
use crate::Payload;
#[de... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/yank.rs | yazi-dds/src/ember/yank.rs | use std::borrow::Cow;
use hashbrown::HashSet;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_parser::mgr::UpdateYankedOpt;
use yazi_shared::url::UrlBufCov;
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberYank<'a>(UpdateYankedOpt<'a>);
impl<'a> EmberYank<'a>... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/cd.rs | yazi-dds/src/ember/cd.rs | use std::borrow::Cow;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::{Id, url::UrlBuf};
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberCd<'a> {
pub tab: Id,
pub url: Cow<'a, UrlBuf>,
#[serde(skip)]
dummy: bool,
}
impl<'a> EmberCd<'a> {
pub f... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/rename.rs | yazi-dds/src/ember/rename.rs | use std::borrow::Cow;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::{Id, url::UrlBuf};
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberRename<'a> {
pub tab: Id,
pub from: Cow<'a, UrlBuf>,
pub to: Cow<'a, UrlBuf>,
}
impl<'a> EmberRename<'a> {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/hi.rs | yazi-dds/src/ember/hi.rs | use std::borrow::Cow;
use hashbrown::HashSet;
use mlua::{ExternalResult, IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::SStr;
use super::Ember;
/// Client handshake
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberHi<'a> {
/// Kinds of events the client can handle
pub abilities... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/hover.rs | yazi-dds/src/ember/hover.rs | use std::borrow::Cow;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::{Id, url::UrlBuf};
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberHover<'a> {
pub tab: Id,
pub url: Option<Cow<'a, UrlBuf>>,
}
impl<'a> EmberHover<'a> {
pub fn borrowed(tab: Id... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/hey.rs | yazi-dds/src/ember/hey.rs | use hashbrown::HashMap;
use mlua::{ExternalResult, IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::{Id, SStr};
use super::{Ember, EmberHi};
use crate::Peer;
/// Server handshake
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberHey {
pub peers: HashMap<Id, Peer>,
pub version: SS... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/mod.rs | yazi-dds/src/ember/mod.rs | yazi_macro::mod_flat!(
bulk bye cd custom delete duplicate ember hey hi hover load mount r#move rename tab trash yank
);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/trash.rs | yazi-dds/src/ember/trash.rs | use std::borrow::Cow;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_shared::url::UrlBuf;
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberTrash<'a> {
pub urls: Cow<'a, Vec<UrlBuf>>,
}
impl<'a> EmberTrash<'a> {
pub fn borrowed(urls: &'a Vec<UrlBuf>) -> Emb... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-dds/src/ember/load.rs | yazi-dds/src/ember/load.rs | use std::borrow::Cow;
use mlua::{IntoLua, Lua, Value};
use serde::{Deserialize, Serialize};
use yazi_fs::FolderStage;
use yazi_shared::{Id, url::UrlBuf};
use super::Ember;
#[derive(Debug, Deserialize, Serialize)]
pub struct EmberLoad<'a> {
pub tab: Id,
pub url: Cow<'a, UrlBuf>,
pub stage: Cow<'a, FolderStage>... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.