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-scheduler/src/in.rs
yazi-scheduler/src/in.rs
use yazi_shared::Id; use crate::{file::{FileInCopy, FileInCut, FileInDelete, FileInDownload, FileInHardlink, FileInLink, FileInTrash, FileInUpload}, hook::{HookInOutCopy, HookInOutCut, HookInOutDelete, HookInOutDownload, HookInOutTrash}, impl_from_in, plugin::PluginInEntry, prework::{PreworkInFetch, PreworkInLoad, Pre...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/progress.rs
yazi-scheduler/src/progress.rs
use serde::Serialize; use yazi_parser::app::TaskSummary; use crate::{file::{FileProgCopy, FileProgCut, FileProgDelete, FileProgDownload, FileProgHardlink, FileProgLink, FileProgTrash, FileProgUpload}, impl_from_prog, plugin::PluginProgEntry, prework::{PreworkProgFetch, PreworkProgLoad, PreworkProgSize}, process::{Proc...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/out.rs
yazi-scheduler/src/out.rs
use crate::{Task, file::{FileOutCopy, FileOutCopyDo, FileOutCut, FileOutCutDo, FileOutDelete, FileOutDeleteDo, FileOutDownload, FileOutDownloadDo, FileOutHardlink, FileOutHardlinkDo, FileOutLink, FileOutTrash, FileOutUpload, FileOutUploadDo}, hook::{HookInOutCopy, HookInOutCut, HookInOutDelete, HookInOutDownload, HookI...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/macros.rs
yazi-scheduler/src/macros.rs
#[macro_export] macro_rules! ctx { ($task:ident, $result:expr) => {{ use anyhow::Context; $result.with_context(|| format!("Failed to work on {:?}", $task)) }}; ($task:ident, $result:expr, $($args:tt)*) => {{ use anyhow::Context; $result.with_context(|| format!("Failed to work on {:?}: {}", $task, format_args...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/task.rs
yazi-scheduler/src/task.rs
use tokio::sync::mpsc; use yazi_shared::{CompletionToken, Id}; use crate::{TaskIn, TaskProg}; #[derive(Debug)] pub struct Task { pub id: Id, pub name: String, pub(crate) prog: TaskProg, pub(crate) hook: Option<TaskIn>, pub done: CompletionToken, pub logs: String, pub logger: Option<mp...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/snap.rs
yazi-scheduler/src/snap.rs
use serde::Serialize; use crate::{Task, TaskProg}; #[derive(Debug, PartialEq, Eq, Serialize)] pub struct TaskSnap { pub name: String, pub prog: TaskProg, } impl From<&Task> for TaskSnap { fn from(task: &Task) -> Self { Self { name: task.name.clone(), prog: task.prog } } }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/scheduler.rs
yazi-scheduler/src/scheduler.rs
use std::{sync::Arc, time::Duration}; use parking_lot::Mutex; use tokio::{select, sync::mpsc::{self, UnboundedReceiver}, task::JoinHandle}; use yazi_config::{YAZI, plugin::{Fetcher, Preloader}}; use yazi_parser::{app::PluginOpt, tasks::ProcessOpenOpt}; use yazi_shared::{CompletionToken, Id, Throttle, url::{UrlBuf, Url...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/process/process.rs
yazi-scheduler/src/process/process.rs
use anyhow::{Result, anyhow}; use tokio::{io::{AsyncBufReadExt, BufReader}, select, sync::mpsc}; use yazi_binding::Permit; use yazi_proxy::{AppProxy, HIDER}; use super::{ProcessInBg, ProcessInBlock, ProcessInOrphan, ShellOpt}; use crate::{TaskOp, TaskOps, process::{ProcessOutBg, ProcessOutBlock, ProcessOutOrphan}}; p...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/process/in.rs
yazi-scheduler/src/process/in.rs
use std::ffi::OsString; use yazi_shared::{CompletionToken, Id, url::UrlCow}; use super::ShellOpt; // --- Block #[derive(Debug)] pub(crate) struct ProcessInBlock { pub(crate) id: Id, pub(crate) cwd: UrlCow<'static>, pub(crate) cmd: OsString, pub(crate) args: Vec<UrlCow<'static>>, } impl From<ProcessInBlock> ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/process/shell.rs
yazi-scheduler/src/process/shell.rs
use std::{ffi::OsString, process::Stdio}; use anyhow::Result; use tokio::process::{Child, Command}; use yazi_fs::Cwd; use yazi_shared::url::{AsUrl, UrlCow}; pub(crate) struct ShellOpt { pub(crate) cwd: UrlCow<'static>, pub(crate) cmd: OsString, pub(crate) args: Vec<UrlCow<'static>>, pub(crate) piped: boo...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/process/progress.rs
yazi-scheduler/src/process/progress.rs
use serde::Serialize; use yazi_parser::app::TaskSummary; // --- Block #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] pub struct ProcessProgBlock { pub state: Option<bool>, } impl From<ProcessProgBlock> for TaskSummary { fn from(value: ProcessProgBlock) -> Self { Self { total: (value.state =...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/process/out.rs
yazi-scheduler/src/process/out.rs
use crate::{Task, TaskProg}; #[derive(Debug)] pub(crate) enum ProcessOutBlock { Succ, Fail(String), } impl From<std::io::Error> for ProcessOutBlock { fn from(value: std::io::Error) -> Self { Self::Fail(value.to_string()) } } impl ProcessOutBlock { pub(crate) fn reduce(self, task: &mut Task) { let TaskProg::Pro...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/process/mod.rs
yazi-scheduler/src/process/mod.rs
yazi_macro::mod_flat!(out process progress r#in shell);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/plugin/in.rs
yazi-scheduler/src/plugin/in.rs
use yazi_parser::app::PluginOpt; use yazi_shared::Id; #[derive(Debug)] pub(crate) struct PluginInEntry { pub(crate) id: Id, pub(crate) opt: PluginOpt, }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/plugin/progress.rs
yazi-scheduler/src/plugin/progress.rs
use serde::Serialize; use yazi_parser::app::TaskSummary; // --- Entry #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] pub struct PluginProgEntry { pub state: Option<bool>, } impl From<PluginProgEntry> for TaskSummary { fn from(value: PluginProgEntry) -> Self { Self { total: 1, success: (v...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/plugin/out.rs
yazi-scheduler/src/plugin/out.rs
use crate::{Task, TaskProg}; // --- Entry #[derive(Debug)] pub(crate) enum PluginOutEntry { Succ, Fail(String), } impl From<mlua::Error> for PluginOutEntry { fn from(value: mlua::Error) -> Self { Self::Fail(value.to_string()) } } impl PluginOutEntry { pub(crate) fn reduce(self, task: &mut Task) { let TaskProg:...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/plugin/mod.rs
yazi-scheduler/src/plugin/mod.rs
yazi_macro::mod_flat!(out plugin progress r#in);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/plugin/plugin.rs
yazi-scheduler/src/plugin/plugin.rs
use anyhow::Result; use tokio::sync::mpsc; use yazi_plugin::isolate; use super::PluginInEntry; use crate::{HIGH, TaskIn, TaskOp, TaskOps, plugin::PluginOutEntry}; pub(crate) struct Plugin { ops: TaskOps, r#macro: async_priority_channel::Sender<TaskIn, u8>, } impl Plugin { pub(crate) fn new( ops: &mpsc::Unbo...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/prework/in.rs
yazi-scheduler/src/prework/in.rs
use std::sync::Arc; use yazi_config::plugin::{Fetcher, Preloader}; use yazi_shared::{Id, Throttle, url::UrlBuf}; #[derive(Debug)] pub(crate) struct PreworkInFetch { pub(crate) id: Id, pub(crate) plugin: &'static Fetcher, pub(crate) targets: Vec<yazi_fs::File>, } #[derive(Clone, Debug)] pub(crate) struct Pre...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/prework/prework.rs
yazi-scheduler/src/prework/prework.rs
use std::num::NonZeroUsize; use anyhow::Result; use hashbrown::{HashMap, HashSet}; use lru::LruCache; use parking_lot::{Mutex, RwLock}; use tokio::sync::mpsc; use tokio_util::sync::CancellationToken; use tracing::error; use yazi_config::Priority; use yazi_fs::{FilesOp, FsHash64}; use yazi_plugin::isolate; use yazi_sha...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/prework/progress.rs
yazi-scheduler/src/prework/progress.rs
use serde::Serialize; use yazi_parser::app::TaskSummary; // --- Fetch #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] pub struct PreworkProgFetch { pub state: Option<bool>, } impl From<PreworkProgFetch> for TaskSummary { fn from(value: PreworkProgFetch) -> Self { Self { total: 1, success:...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/prework/out.rs
yazi-scheduler/src/prework/out.rs
use crate::{Task, TaskProg}; // --- Fetch #[derive(Debug)] pub(crate) enum PreworkOutFetch { Succ, Fail(String), } impl From<mlua::Error> for PreworkOutFetch { fn from(value: mlua::Error) -> Self { Self::Fail(value.to_string()) } } impl PreworkOutFetch { pub(crate) fn reduce(self, task: &mut Task) { let TaskPr...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/prework/mod.rs
yazi-scheduler/src/prework/mod.rs
yazi_macro::mod_flat!(out prework progress r#in);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/in.rs
yazi-scheduler/src/file/in.rs
use std::{mem, path::PathBuf}; use tokio::sync::mpsc; use yazi_fs::cha::Cha; use yazi_shared::{CompletionToken, Id, url::UrlBuf}; // --- Copy #[derive(Clone, Debug)] pub(crate) struct FileInCopy { pub(crate) id: Id, pub(crate) from: UrlBuf, pub(crate) to: UrlBuf, pub(crate) force: bool, pub(crate) cha...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/file.rs
yazi-scheduler/src/file/file.rs
use std::mem; use anyhow::{Context, Result, anyhow}; use tokio::{io::{self, ErrorKind::NotFound}, sync::mpsc}; use tracing::warn; use yazi_config::YAZI; use yazi_fs::{Cwd, FsHash128, FsUrl, cha::Cha, ok_or_not_found, path::path_relative_to, provider::{Attrs, FileHolder, Provider, local::Local}}; use yazi_shared::{path...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/progress.rs
yazi-scheduler/src/file/progress.rs
use serde::Serialize; use yazi_parser::app::TaskSummary; // --- Copy #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] pub struct FileProgCopy { pub total_files: u32, pub success_files: u32, pub failed_files: u32, pub total_bytes: u64, pub processed_bytes: u64, pub collected: Op...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/out.rs
yazi-scheduler/src/file/out.rs
use std::io; use crate::{Task, TaskProg}; // --- Copy #[derive(Debug)] pub(crate) enum FileOutCopy { New(u64), Deform(String), Succ, Fail(String), Clean, } impl From<anyhow::Error> for FileOutCopy { fn from(value: anyhow::Error) -> Self { Self::Fail(format!("{value:?}")) } } impl From<std::io::Error> for File...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/mod.rs
yazi-scheduler/src/file/mod.rs
yazi_macro::mod_flat!(file out progress r#in transaction traverse);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/traverse.rs
yazi-scheduler/src/file/traverse.rs
use std::{collections::VecDeque, fmt::Debug}; use yazi_fs::{FsUrl, cha::Cha, path::skip_url, provider::{DirReader, FileHolder}}; use yazi_shared::{strand::StrandLike, url::{AsUrl, Url, UrlBuf, UrlLike}}; use yazi_vfs::provider::{self}; use crate::{ctx, file::{FileInCopy, FileInCut, FileInDelete, FileInDownload, FileI...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/file/transaction.rs
yazi-scheduler/src/file/transaction.rs
use std::{hash::{BuildHasher, Hash, Hasher}, io}; use yazi_macro::ok_or_not_found; use yazi_shared::{timestamp_us, url::{AsUrl, Url, UrlBuf}}; use yazi_vfs::{provider, unique_file}; pub(super) struct Transaction; impl Transaction { pub(super) async fn tmp<U>(url: U) -> io::Result<UrlBuf> where U: AsUrl, { Sel...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/hook/hook.rs
yazi-scheduler/src/hook/hook.rs
use std::sync::Arc; use parking_lot::Mutex; use tokio::sync::mpsc; use yazi_dds::Pump; use yazi_fs::ok_or_not_found; use yazi_proxy::TasksProxy; use yazi_vfs::provider; use crate::{Ongoing, TaskOp, TaskOps, file::{FileOutCopy, FileOutCut, FileOutDelete, FileOutDownload, FileOutTrash}, hook::{HookInOutCopy, HookInOutC...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/hook/in.rs
yazi-scheduler/src/hook/in.rs
use yazi_shared::{Id, url::UrlBuf}; use crate::{Task, TaskProg, file::{FileInCopy, FileInCut}}; // --- Copy #[derive(Debug)] pub(crate) struct HookInOutCopy { pub(crate) id: Id, pub(crate) from: UrlBuf, pub(crate) to: UrlBuf, } impl From<&FileInCopy> for HookInOutCopy { fn from(value: &FileInCopy) -> Self { ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-scheduler/src/hook/mod.rs
yazi-scheduler/src/hook/mod.rs
yazi_macro::mod_flat!(hook r#in);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-ffi/src/disk_arbitration.rs
yazi-ffi/src/disk_arbitration.rs
use std::ffi::{c_char, c_void}; use core_foundation_sys::{array::CFArrayRef, base::CFAllocatorRef, dictionary::CFDictionaryRef, runloop::CFRunLoopRef, string::CFStringRef}; #[link(name = "DiskArbitration", kind = "framework")] unsafe extern "C" { pub fn DASessionCreate(allocator: CFAllocatorRef) -> *const c_void; ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-ffi/src/cf_dict.rs
yazi-ffi/src/cf_dict.rs
use std::{ffi::{CStr, OsStr, OsString, c_char, c_void}, mem::ManuallyDrop, os::unix::ffi::OsStrExt, path::PathBuf}; use anyhow::{Result, bail}; use core_foundation_sys::{base::{CFRelease, TCFTypeRef}, dictionary::{CFDictionaryGetValueIfPresent, CFDictionaryRef}, string::CFStringRef}; use objc2::{msg_send, runtime::Any...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-ffi/src/lib.rs
yazi-ffi/src/lib.rs
#[cfg(target_os = "macos")] yazi_macro::mod_flat!(cf_dict cf_string disk_arbitration io_kit);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-ffi/src/cf_string.rs
yazi-ffi/src/cf_string.rs
use std::{ffi::OsString, ops::Deref, os::unix::ffi::OsStringExt}; use anyhow::{Result, bail}; use core_foundation_sys::{base::{CFRelease, kCFAllocatorDefault, kCFAllocatorNull}, string::{CFStringCreateWithBytesNoCopy, CFStringGetCString, CFStringGetLength, CFStringGetMaximumSizeForEncoding, CFStringRef, kCFStringEncod...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-ffi/src/io_kit.rs
yazi-ffi/src/io_kit.rs
use std::ffi::c_char; use core_foundation_sys::{base::{CFAllocatorRef, CFTypeRef, mach_port_t}, dictionary::CFMutableDictionaryRef, string::CFStringRef}; use libc::kern_return_t; #[link(name = "IOKit", kind = "framework")] unsafe extern "C" { pub fn IOServiceGetMatchingServices( mainPort: mach_port_t, matching: ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/app.rs
yazi-proxy/src/app.rs
use std::time::Duration; use tokio::sync::oneshot; use yazi_macro::{emit, relay}; use yazi_parser::app::{NotifyLevel, NotifyOpt, PluginOpt, TaskSummary}; pub struct AppProxy; impl AppProxy { pub async fn stop() { let (tx, rx) = oneshot::channel::<()>(); emit!(Call(relay!(app:stop).with_any("tx", tx))); rx.awa...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/tasks.rs
yazi-proxy/src/tasks.rs
use std::ffi::OsString; use yazi_macro::{emit, relay}; use yazi_parser::tasks::ProcessOpenOpt; use yazi_shared::{CompletionToken, url::{UrlBuf, UrlCow}}; pub struct TasksProxy; impl TasksProxy { // TODO: remove pub fn open_shell_compat(opt: ProcessOpenOpt) { emit!(Call(relay!(tasks:open_shell_compat).with_any("o...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/mgr.rs
yazi-proxy/src/mgr.rs
use std::borrow::Cow; use yazi_macro::{emit, relay}; use yazi_parser::mgr::{DisplaceDoOpt, FilterOpt, FindDoOpt, OpenDoOpt, OpenOpt, SearchOpt, UpdatePeekedOpt, UpdateSpottedOpt}; use yazi_shared::{Id, SStr, url::UrlBuf}; pub struct MgrProxy; impl MgrProxy { pub fn arrow(step: impl Into<SStr>) { emit!(Call(relay!...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/lib.rs
yazi-proxy/src/lib.rs
mod macros; yazi_macro::mod_flat!(app cmp confirm input mgr pick semaphore tasks which); pub fn init() { crate::init_semaphore(); }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/which.rs
yazi-proxy/src/which.rs
use yazi_macro::{emit, relay}; use yazi_parser::which::ShowOpt; pub struct WhichProxy; impl WhichProxy { pub fn show(opt: ShowOpt) { emit!(Call(relay!(which:show).with_any("opt", opt))); } }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/pick.rs
yazi-proxy/src/pick.rs
use tokio::sync::oneshot; use yazi_config::popup::PickCfg; use yazi_macro::{emit, relay}; pub struct PickProxy; impl PickProxy { pub async fn show(cfg: PickCfg) -> anyhow::Result<usize> { let (tx, rx) = oneshot::channel(); emit!(Call(relay!(pick:show).with_any("tx", tx).with_any("cfg", cfg))); rx.await? } }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/macros.rs
yazi-proxy/src/macros.rs
#[macro_export] macro_rules! deprecate { ($content:expr) => {{ static WARNED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); if !WARNED.swap(true, std::sync::atomic::Ordering::Relaxed) { $crate::emit!(Call( yazi_shared::event::Cmd::new("app:deprecate").with("content", format!($tt...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/cmp.rs
yazi-proxy/src/cmp.rs
use yazi_macro::{emit, relay}; use yazi_parser::cmp::ShowOpt; use yazi_shared::Id; pub struct CmpProxy; impl CmpProxy { pub fn show(opt: ShowOpt) { emit!(Call(relay!(cmp:show).with_any("opt", opt))); } pub fn trigger(word: impl Into<String>, ticket: Id) { emit!(Call(relay!(cmp:trigger, [word.into()]).with("ti...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/semaphore.rs
yazi-proxy/src/semaphore.rs
use tokio::sync::Semaphore; use yazi_shared::RoCell; pub static HIDER: RoCell<Semaphore> = RoCell::new(); pub(super) fn init_semaphore() { HIDER.init(Semaphore::new(1)); }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/confirm.rs
yazi-proxy/src/confirm.rs
use tokio::sync::oneshot; use yazi_config::popup::ConfirmCfg; use yazi_macro::{emit, relay}; pub struct ConfirmProxy; impl ConfirmProxy { pub async fn show(cfg: ConfirmCfg) -> bool { Self::show_rx(cfg).await.unwrap_or(false) } pub fn show_rx(cfg: ConfirmCfg) -> oneshot::Receiver<bool> { let (tx, rx) = oneshot::c...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-proxy/src/input.rs
yazi-proxy/src/input.rs
use tokio::sync::mpsc; use yazi_config::popup::InputCfg; use yazi_macro::{emit, relay}; use yazi_shared::errors::InputError; pub struct InputProxy; impl InputProxy { pub fn show(cfg: InputCfg) -> mpsc::UnboundedReceiver<Result<String, InputError>> { let (tx, rx) = mpsc::unbounded_channel(); emit!(Call(relay!(inp...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/icon.rs
yazi-binding/src/icon.rs
use std::ops::Deref; use mlua::{UserData, UserDataFields, Value}; use crate::{Style, cached_field}; pub struct Icon { inner: &'static yazi_config::Icon, v_text: Option<Value>, v_style: Option<Value>, } impl Deref for Icon { type Target = yazi_config::Icon; fn deref(&self) -> &Self::Target { self.inner } } ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/stage.rs
yazi-binding/src/stage.rs
use mlua::{IntoLuaMulti, MetaMethod, UserData, UserDataMethods}; pub struct FolderStage(yazi_fs::FolderStage); impl FolderStage { pub fn new(inner: yazi_fs::FolderStage) -> Self { Self(inner) } } impl UserData for FolderStage { fn add_methods<M: UserDataMethods<Self>>(methods: &mut M) { methods.add_meta_method(M...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/path.rs
yazi-binding/src/path.rs
use std::ops::Deref; use mlua::{ExternalError, ExternalResult, FromLua, Lua, MetaMethod, UserData, UserDataFields, UserDataMethods, UserDataRef, Value}; use yazi_shared::{path::{PathBufDyn, PathLike, StripPrefixError}, strand::{AsStrand, Strand, StrandCow}}; use crate::cached_field; pub type PathRef = UserDataRef<Pa...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/lib.rs
yazi-binding/src/lib.rs
mod macros; yazi_macro::mod_pub!(elements); yazi_macro::mod_flat!(cha color composer error file handle icon id iter path permit runtime scheme stage style url utils);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/permit.rs
yazi-binding/src/permit.rs
use std::{mem, ops::Deref}; use futures::{FutureExt, future::BoxFuture}; use mlua::{UserData, prelude::LuaUserDataMethods}; use tokio::sync::SemaphorePermit; pub type PermitRef = mlua::UserDataRef<Permit>; pub struct Permit { inner: Option<SemaphorePermit<'static>>, destruct: Option<BoxFuture<'static, ()>>, } ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/id.rs
yazi-binding/src/id.rs
use std::ops::Deref; use mlua::{ExternalError, ExternalResult, FromLua, Lua, UserData, Value}; #[derive(Clone, Copy)] pub struct Id(pub yazi_shared::Id); impl Deref for Id { type Target = yazi_shared::Id; fn deref(&self) -> &Self::Target { &self.0 } } impl FromLua for Id { fn from_lua(value: Value, _: &Lua) -> ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/url.rs
yazi-binding/src/url.rs
use std::ops::Deref; use mlua::{AnyUserData, ExternalError, ExternalResult, FromLua, IntoLua, Lua, MetaMethod, UserData, UserDataFields, UserDataMethods, UserDataRef, Value}; use yazi_fs::{FsHash64, FsHash128, FsUrl}; use yazi_shared::{path::{PathLike, StripPrefixError}, scheme::SchemeCow, strand::{StrandLike, ToStran...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/error.rs
yazi-binding/src/error.rs
use std::{borrow::Cow, fmt::Display}; use mlua::{ExternalError, FromLua, Lua, MetaMethod, UserData, UserDataFields, UserDataMethods, Value}; use yazi_shared::SStr; const EXPECTED: &str = "expected a Error"; pub enum Error { Io(std::io::Error), Fs(yazi_fs::error::Error), Serde(serde_json::Error), Custom(SStr), } ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/file.rs
yazi-binding/src/file.rs
use std::ops::Deref; use mlua::{AnyUserData, ExternalError, FromLua, Lua, ObjectLike, Table, UserData, UserDataFields, UserDataMethods, UserDataRef, Value}; use crate::{Cha, Url, impl_file_fields, impl_file_methods}; pub type FileRef = UserDataRef<File>; const EXPECTED: &str = "expected a table, File, or fs::File";...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/utils.rs
yazi-binding/src/utils.rs
use mlua::{IntoLua, Lua, SerializeOptions, Table, Value}; pub const SER_OPT: SerializeOptions = SerializeOptions::new().serialize_none_to_null(false).serialize_unit_to_null(false); pub fn get_metatable(lua: &Lua, value: impl IntoLua) -> mlua::Result<Table> { let (_, mt): (Value, Table) = unsafe { lua.exec_raw(val...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/runtime.rs
yazi-binding/src/runtime.rs
use std::collections::VecDeque; use hashbrown::HashMap; use mlua::Function; #[derive(Debug)] pub struct Runtime { frames: VecDeque<RuntimeFrame>, blocks: HashMap<String, Vec<Function>>, pub initing: bool, } #[derive(Debug)] struct RuntimeFrame { id: String, calls: usize, } impl Runtime { pub fn n...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/macros.rs
yazi-binding/src/macros.rs
#[macro_export] macro_rules! runtime { ($lua:ident) => {{ use mlua::ExternalError; $lua.app_data_ref::<$crate::Runtime>().ok_or_else(|| "Runtime not found".into_lua_err()) }}; } #[macro_export] macro_rules! runtime_mut { ($lua:ident) => {{ use mlua::ExternalError; $lua.app_data_mut::<$crate::Runtime>().ok_o...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/style.rs
yazi-binding/src/style.rs
use mlua::{AnyUserData, ExternalError, IntoLua, Lua, LuaSerdeExt, MetaMethod, Table, UserData, UserDataMethods, Value}; use crate::SER_OPT; #[derive(Clone, Copy, Default)] pub struct Style(pub ratatui::style::Style); impl Style { pub fn compose(lua: &Lua) -> mlua::Result<Value> { let new = lua.create_function(|_,...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/composer.rs
yazi-binding/src/composer.rs
use hashbrown::HashMap; use mlua::{Lua, MetaMethod, UserData, UserDataMethods, Value}; pub type ComposerGet = fn(&Lua, &[u8]) -> mlua::Result<Value>; pub type ComposerSet = fn(&Lua, &[u8], Value) -> mlua::Result<Value>; pub struct Composer<G, S> { get: G, set: S, parent: Option<(G, S)>, cache: HashMap<Vec<...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/scheme.rs
yazi-binding/src/scheme.rs
use std::ops::Deref; use mlua::{UserData, UserDataFields, Value}; use yazi_fs::FsScheme; use yazi_shared::scheme::SchemeLike; use crate::{Path, cached_field}; pub struct Scheme { inner: yazi_shared::scheme::Scheme, v_kind: Option<Value>, v_cache: Option<Value>, } impl Deref for Scheme { type Target = yazi_sha...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/cha.rs
yazi-binding/src/cha.rs
use std::{ops::Deref, time::{Duration, SystemTime}}; use mlua::{ExternalError, FromLua, IntoLua, Lua, Table, UserData, UserDataFields, UserDataMethods}; use yazi_fs::{FsHash128, cha::{ChaKind, ChaMode}}; #[derive(Clone, Copy, FromLua)] pub struct Cha(pub yazi_fs::cha::Cha); impl Deref for Cha { type Target = yazi_f...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/color.rs
yazi-binding/src/color.rs
use std::str::FromStr; use mlua::{ExternalError, ExternalResult, UserData, Value}; #[derive(Clone, Copy, Default)] pub struct Color(pub ratatui::style::Color); impl TryFrom<Value> for Color { type Error = mlua::Error; fn try_from(value: Value) -> Result<Self, Self::Error> { Ok(Self(match value { Value::Strin...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/iter.rs
yazi-binding/src/iter.rs
use mlua::{AnyUserData, ExternalError, FromLua, IntoLua, IntoLuaMulti, Lua, MetaMethod, UserData, UserDataMethods, UserDataRefMut, Value}; pub struct Iter<I: Iterator<Item = T>, T> { iter: I, len: Option<usize>, count: usize, cache: Vec<Value>, } impl<I, T> Iter<I, T> where I: Iterator<Item = T> + 'static, T:...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/handle.rs
yazi-binding/src/handle.rs
use mlua::{MultiValue, UserData, UserDataMethods}; use tokio::task::JoinHandle; pub enum Handle { AsyncFn(JoinHandle<mlua::Result<MultiValue>>), } impl UserData for Handle { fn add_methods<M: UserDataMethods<Self>>(methods: &mut M) { methods.add_method("abort", |_, me, ()| { Ok(match me { Self::AsyncFn(h) ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/gauge.rs
yazi-binding/src/elements/gauge.rs
use mlua::{AnyUserData, ExternalError, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; use ratatui::widgets::Widget; use super::{Area, Span}; use crate::Style; #[derive(Clone, Debug, Default)] pub struct Gauge { pub(super) area: Area, ratio: f64, label: Option<ratatui::text::Span<'...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/edge.rs
yazi-binding/src/elements/edge.rs
use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, Value}; use ratatui::widgets::Borders; #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct Edge(pub Borders); impl Deref for Edge { type Target = Borders; fn deref(&self) -> &Self::Target { &self.0 } } impl Edge { pub fn compose(lua: &Lua) -> m...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/pad.rs
yazi-binding/src/elements/pad.rs
use std::ops::{Add, AddAssign, Deref}; use mlua::{FromLua, IntoLua, Lua, MetaMethod, Table, UserData, Value}; #[derive(Clone, Copy, Default, FromLua)] pub struct Pad(ratatui::widgets::Padding); impl Deref for Pad { type Target = ratatui::widgets::Padding; fn deref(&self) -> &Self::Target { &self.0 } } impl From<...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/list.rs
yazi-binding/src/elements/list.rs
use mlua::{ExternalError, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use ratatui::widgets::Widget; use super::{Area, Text}; const EXPECTED: &str = "expected a table of strings, Texts, Lines or Spans"; // --- List #[derive(Clone, Debug, Default)] pub struct List { pub(super) area: Area, inner: ratatui::wid...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/row.rs
yazi-binding/src/elements/row.rs
use mlua::{AnyUserData, ExternalError, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use super::Cell; const EXPECTED: &str = "expected a Row"; #[derive(Clone, Debug, Default)] pub struct Row { pub(super) cells: Vec<Cell>, height: u16, top_margin: u16, bottom_margin: u16, style: ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/table.rs
yazi-binding/src/elements/table.rs
use mlua::{AnyUserData, ExternalError, IntoLua, Lua, MetaMethod, UserData, Value}; use ratatui::widgets::StatefulWidget; use super::{Area, Row}; use crate::{Style, elements::Constraint}; const EXPECTED: &str = "expected a table of Rows"; // --- Table #[derive(Clone, Debug, Default)] pub struct Table { pub area: Are...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/clear.rs
yazi-binding/src/elements/clear.rs
use std::sync::atomic::{AtomicBool, Ordering}; use mlua::{IntoLua, Lua, MetaMethod, Table, UserData, Value}; use yazi_adapter::ADAPTOR; use super::Area; pub static COLLISION: AtomicBool = AtomicBool::new(false); #[derive(Clone, Copy, Debug, Default)] pub struct Clear { pub area: Area, } impl Clear { pub fn compo...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/rect.rs
yazi-binding/src/elements/rect.rs
use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use super::Pad; use crate::deprecate; #[derive(Clone, Copy, Debug, Default, FromLua)] pub struct Rect(pub ratatui::layout::Rect); impl Deref for Rect { type Target = ratatui::layout::Rect; fn deref(&self) -> &Self::Target...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/text.rs
yazi-binding/src/elements/text.rs
use std::{any::TypeId, mem}; use ansi_to_tui::IntoText; use mlua::{AnyUserData, ExternalError, ExternalResult, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use ratatui::widgets::Widget; use super::{Area, Line, Span, Wrap}; use crate::{Error, elements::Align}; const EXPECTED: &str = "expected a string, Line, Sp...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/renderable.rs
yazi-binding/src/elements/renderable.rs
use std::any::TypeId; use mlua::{AnyUserData, ExternalError}; use super::{Bar, Border, Clear, Gauge, Line, List, Table, Text}; use crate::{Error, elements::Area}; #[derive(Clone, Debug)] pub enum Renderable { Line(Line), Text(Text), List(Box<List>), Bar(Bar), Clear(Clear), Border(Border), Gauge(Box<Gauge>), ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/span.rs
yazi-binding/src/elements/span.rs
use std::{borrow::Cow, ops::{Deref, DerefMut}}; use mlua::{AnyUserData, ExternalError, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; use unicode_width::UnicodeWidthChar; const EXPECTED: &str = "expected a string or Span"; pub struct Span(pub(super) ratatui::text::Span<'static>); impl Deref for...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/align.rs
yazi-binding/src/elements/align.rs
use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, Value}; #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct Align(pub(super) ratatui::layout::Alignment); impl Deref for Align { type Target = ratatui::layout::Alignment; fn deref(&self) -> &Self::Target { &self.0 } } impl Align { pub fn compos...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/bar.rs
yazi-binding/src/elements/bar.rs
use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use ratatui::widgets::Borders; use super::{Area, Edge}; #[derive(Clone, Debug, Default)] pub struct Bar { pub(super) area: Area, edge: Edge, symbol: String, style: ratatui::style::Style, } impl Bar { pub fn compose(lua: &Lua) -> mlua...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/mod.rs
yazi-binding/src/elements/mod.rs
yazi_macro::mod_flat!(align area bar border cell clear constraint edge elements gauge layout line list pad pos rect renderable row span table text wrap);
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/layout.rs
yazi-binding/src/elements/layout.rs
use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; use super::{Constraint, Rect}; const HORIZONTAL: bool = true; const VERTICAL: bool = false; #[derive(Clone, Default)] pub struct Layout { direction: bool, margin: Option<ratatui::layout::Margin>, constraints: Vec<ra...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/area.rs
yazi-binding/src/elements/area.rs
use std::fmt::Debug; use mlua::{AnyUserData, ExternalError, FromLua, IntoLua, Value}; use super::{Pos, Rect}; const EXPECTED: &str = "expected a Pos or Rect"; #[derive(Clone, Copy)] pub enum Area { Pos(Pos), Rect(Rect), } impl Default for Area { fn default() -> Self { Self::Rect(Default::default()) } } impl Ar...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/elements.rs
yazi-binding/src/elements/elements.rs
use mlua::{AnyUserData, IntoLua, Lua, Value}; use tracing::error; use super::Renderable; use crate::{Composer, ComposerGet, ComposerSet}; pub fn compose(p_get: ComposerGet, p_set: ComposerSet) -> Composer<ComposerGet, ComposerSet> { fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> { match key { b"Align" => ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/line.rs
yazi-binding/src/elements/line.rs
use std::{borrow::Cow, mem, ops::{Deref, DerefMut}}; use ansi_to_tui::IntoText; use mlua::{AnyUserData, ExternalError, ExternalResult, IntoLua, Lua, MetaMethod, Table, UserData, UserDataMethods, Value}; use ratatui::widgets::Widget; use unicode_width::UnicodeWidthChar; use super::{Area, Span}; use crate::elements::Al...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/border.rs
yazi-binding/src/elements/border.rs
use mlua::{AnyUserData, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use ratatui::widgets::{Borders, Widget}; use super::{Area, Edge}; use crate::elements::Line; // Type const PLAIN: u8 = 0; const ROUNDED: u8 = 1; const DOUBLE: u8 = 2; const THICK: u8 = 3; const QUADRANT_INSIDE: u8 = 4; const QUADRANT_OUTSIDE: ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/constraint.rs
yazi-binding/src/elements/constraint.rs
use mlua::{FromLua, IntoLua, Lua, UserData, Value}; #[derive(Clone, Copy, Default, FromLua)] pub struct Constraint(pub(super) ratatui::layout::Constraint); impl Constraint { pub fn compose(lua: &Lua) -> mlua::Result<Value> { use ratatui::layout::Constraint as C; lua .create_table_from([ ("Min", lua.creat...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/cell.rs
yazi-binding/src/elements/cell.rs
use mlua::{ExternalError, FromLua}; use super::Text; const EXPECTED: &str = "expected a table of strings, Texts, Lines or Spans"; #[derive(Clone, Debug)] pub struct Cell { pub(super) text: ratatui::text::Text<'static>, } impl From<Cell> for ratatui::widgets::Cell<'static> { fn from(value: Cell) -> Self { Self::ne...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/pos.rs
yazi-binding/src/elements/pos.rs
use std::{ops::Deref, str::FromStr}; use mlua::{AnyUserData, ExternalError, ExternalResult, IntoLua, Lua, MetaMethod, Table, UserData, Value}; use super::Pad; const EXPECTED: &str = "expected a Pos"; #[derive(Clone, Copy, Default)] pub struct Pos { inner: yazi_config::popup::Position, pub(super) pad: Pad, } imp...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-binding/src/elements/wrap.rs
yazi-binding/src/elements/wrap.rs
use std::ops::Deref; use mlua::{FromLua, IntoLua, Lua, Value}; use yazi_config::preview::PreviewWrap; #[derive(Clone, Copy, Debug, Default)] pub struct Wrap(pub(super) Option<ratatui::widgets::Wrap>); impl Deref for Wrap { type Target = Option<ratatui::widgets::Wrap>; fn deref(&self) -> &Self::Target { &self.0 } ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/op.rs
yazi-fs/src/op.rs
use std::path::Path; use hashbrown::{HashMap, HashSet}; use yazi_macro::relay; use yazi_shared::{Id, Ids, path::PathBufDyn, url::{UrlBuf, UrlLike}}; use super::File; use crate::{cha::Cha, error::Error}; pub static FILES_TICKET: Ids = Ids::new(); #[derive(Clone, Debug)] pub enum FilesOp { Full(UrlBuf, Vec<File>, Ch...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/xdg.rs
yazi-fs/src/xdg.rs
use std::{env, path::PathBuf, sync::OnceLock}; pub struct Xdg; impl Xdg { pub fn config_dir() -> PathBuf { if let Some(p) = env::var_os("YAZI_CONFIG_HOME").map(PathBuf::from) && p.is_absolute() { return p; } #[cfg(windows)] { dirs::config_dir() .map(|p| p.join("yazi").join("config")) .exp...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/stage.rs
yazi-fs/src/stage.rs
use serde::{Deserialize, Serialize}; use crate::error::Error; #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub enum FolderStage { #[default] Loading, Loaded, Failed(Error), } impl FolderStage { pub fn is_loading(&self) -> bool { *self == Self::Loading } }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/lib.rs
yazi-fs/src/lib.rs
yazi_macro::mod_pub!(cha error mounts path provider); yazi_macro::mod_flat!(cwd file files filter fns hash op scheme sorter sorting splatter stage url xdg); pub fn init() { CWD.init(<_>::default()); mounts::init(); }
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/filter.rs
yazi-fs/src/filter.rs
use std::{fmt::Display, ops::Range}; use anyhow::Result; use regex::bytes::{Regex, RegexBuilder}; use yazi_shared::{event::Cmd, strand::AsStrand}; pub struct Filter { raw: String, regex: Regex, } impl Filter { pub fn new(s: &str, case: FilterCase) -> Result<Self> { let regex = match case { FilterCase::Smar...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/sorting.rs
yazi-fs/src/sorting.rs
use std::{fmt::Display, str::FromStr}; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] pub enum SortBy { #[default] None, Mtime, Btime, Extension, Alphabetical, Natural, Size, Random, } impl FromStr for So...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/url.rs
yazi-fs/src/url.rs
use std::{borrow::Cow, ffi::OsStr, path::{Path, PathBuf}}; use yazi_shared::{path::{AsPath, PathDyn}, url::{AsUrl, Url, UrlBuf, UrlCow}}; use crate::{FsHash128, FsScheme, path::PercentEncoding}; pub trait FsUrl<'a> { fn cache(&self) -> Option<PathBuf>; fn cache_lock(&self) -> Option<PathBuf>; fn unified_path(se...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/file.rs
yazi-fs/src/file.rs
use std::{hash::{Hash, Hasher}, ops::Deref, path::Path}; use yazi_shared::{path::{PathBufDyn, PathDyn}, strand::Strand, url::{UrlBuf, UrlLike}}; use crate::cha::{Cha, ChaType}; #[derive(Clone, Debug, Default)] pub struct File { pub url: UrlBuf, pub cha: Cha, pub link_to: Option<PathBufDyn>, } impl Deref ...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false
sxyazi/yazi
https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-fs/src/splatter.rs
yazi-fs/src/splatter.rs
#[cfg(unix)] use std::os::unix::ffi::{OsStrExt, OsStringExt}; #[cfg(windows)] use std::os::windows::ffi::{OsStrExt, OsStringExt}; use std::{cell::Cell, ffi::{OsStr, OsString}, iter::{self, Peekable}, mem}; use yazi_shared::url::{AsUrl, Url, UrlCow}; use crate::FsUrl; #[cfg(unix)] type Iter<'a> = Peekable<std::iter::...
rust
MIT
3c39a326abaacb37d9ff15af7668756d60624dfa
2026-01-04T15:33:17.426354Z
false