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-plugin/src/utils/time.rs | yazi-plugin/src/utils/time.rs | use std::time::{SystemTime, UNIX_EPOCH};
use mlua::{ExternalError, Function, Lua};
use super::Utils;
impl Utils {
pub(super) fn time(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_, ()| {
Ok(SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs_f64()).ok())
})
}
pub(super) fn sleep(... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/log.rs | yazi-plugin/src/utils/log.rs | use mlua::{Function, Lua, MultiValue};
use tracing::{debug, error};
use super::Utils;
impl Utils {
pub(super) fn dbg(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_, values: MultiValue| {
let s = values.into_iter().map(|v| format!("{v:#?}")).collect::<Vec<_>>().join(" ");
Ok(debug!("{s}"))
})... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/json.rs | yazi-plugin/src/utils/json.rs | use mlua::{Function, IntoLuaMulti, Lua, LuaSerdeExt, Value};
use yazi_binding::{Error, SER_OPT};
use super::Utils;
impl Utils {
pub(super) fn json_encode(lua: &Lua) -> mlua::Result<Function> {
lua.create_async_function(|lua, value: Value| async move {
match serde_json::to_string(&value) {
Ok(s) => s.into_lu... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/target.rs | yazi-plugin/src/utils/target.rs | use mlua::{Function, Lua};
use super::Utils;
impl Utils {
pub(super) fn target_os(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_, ()| Ok(std::env::consts::OS))
}
pub(super) fn target_family(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_, ()| Ok(std::env::consts::FAMILY))
}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/layer.rs | yazi-plugin/src/utils/layer.rs | use std::{str::FromStr, time::Duration};
use mlua::{ExternalError, ExternalResult, Function, IntoLuaMulti, Lua, Table, Value};
use tokio::sync::mpsc;
use tokio_stream::wrappers::UnboundedReceiverStream;
use yazi_binding::{deprecate, elements::{Line, Pos, Text}, runtime};
use yazi_config::{keymap::{Chord, Key}, popup::... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/text.rs | yazi-plugin/src/utils/text.rs | use mlua::{Function, Lua, Table};
use twox_hash::XxHash3_128;
use unicode_width::UnicodeWidthChar;
use yazi_binding::deprecate;
use yazi_widgets::CLIPBOARD;
use super::Utils;
impl Utils {
pub(super) fn hash(lua: &Lua) -> mlua::Result<Function> {
lua.create_async_function(move |_, s: mlua::String| async move {
O... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/utils.rs | yazi-plugin/src/utils/utils.rs | use mlua::{IntoLua, Lua, Value};
use yazi_binding::{Composer, ComposerSet};
pub(super) struct Utils;
pub fn compose(
isolate: bool,
) -> Composer<impl Fn(&Lua, &[u8]) -> mlua::Result<Value>, ComposerSet> {
fn get(lua: &Lua, key: &[u8], isolate: bool) -> mlua::Result<Value> {
match key {
// App
b"id" => Util... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/mod.rs | yazi-plugin/src/utils/mod.rs | yazi_macro::mod_flat!(
app cache call image json layer log preview process spot sync target text time user utils
);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/spot.rs | yazi-plugin/src/utils/spot.rs | use mlua::{AnyUserData, Function, Lua, Table};
use yazi_binding::elements::{Edge, Renderable};
use yazi_config::THEME;
use yazi_parser::mgr::{SpotLock, UpdateSpottedOpt};
use yazi_proxy::MgrProxy;
use super::Utils;
impl Utils {
pub(super) fn spot_table(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_,... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/cache.rs | yazi-plugin/src/utils/cache.rs | use std::hash::Hash;
use mlua::{Function, Lua, Table};
use yazi_binding::{FileRef, Url};
use yazi_config::YAZI;
use yazi_shared::url::UrlLike;
use yazi_shim::Twox128;
use super::Utils;
impl Utils {
pub(super) fn file_cache(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_, t: Table| {
let file: Fil... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/preview.rs | yazi-plugin/src/utils/preview.rs | use mlua::{AnyUserData, ExternalError, Function, IntoLuaMulti, Lua, Table, Value};
use yazi_binding::{Error, elements::{Area, Renderable, Text}};
use yazi_config::YAZI;
use yazi_fs::FsUrl;
use yazi_parser::mgr::{PreviewLock, UpdatePeekedOpt};
use yazi_proxy::MgrProxy;
use yazi_shared::{errors::PeekError, url::AsUrl};
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/elements/mod.rs | yazi-plugin/src/elements/mod.rs | yazi_macro::mod_flat!(elements);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/elements/elements.rs | yazi-plugin/src/elements/elements.rs | use std::borrow::Cow;
use mlua::{AnyUserData, ExternalError, IntoLua, Lua, ObjectLike, Table, Value};
use tracing::error;
use unicode_width::{UnicodeWidthChar, UnicodeWidthStr};
use yazi_binding::{Composer, ComposerGet, ComposerSet, Permit, PermitRef, elements::{Line, Rect, Span}, runtime};
use yazi_config::LAYOUT;
us... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/range.rs | yazi-plugin/src/bindings/range.rs | use mlua::{IntoLua, Lua};
pub struct Range<T>(std::ops::Range<T>);
impl<T> From<std::ops::Range<T>> for Range<T> {
fn from(value: std::ops::Range<T>) -> Self { Self(value) }
}
impl<T> IntoLua for Range<T>
where
T: IntoLua,
{
fn into_lua(self, lua: &Lua) -> mlua::Result<mlua::Value> {
lua.create_sequence_from([s... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/chan.rs | yazi-plugin/src/bindings/chan.rs | use mlua::{ExternalError, IntoLuaMulti, UserData, Value};
use yazi_binding::Error;
pub struct MpscTx(pub tokio::sync::mpsc::Sender<Value>);
pub struct MpscRx(pub tokio::sync::mpsc::Receiver<Value>);
impl UserData for MpscTx {
fn add_methods<M: mlua::UserDataMethods<Self>>(methods: &mut M) {
methods.add_async_metho... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/image.rs | yazi-plugin/src/bindings/image.rs | use std::ops::Deref;
use mlua::{MetaMethod, UserData};
pub struct ImageInfo(yazi_adapter::ImageInfo);
impl Deref for ImageInfo {
type Target = yazi_adapter::ImageInfo;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl From<yazi_adapter::ImageInfo> for ImageInfo {
fn from(value: yazi_adapter::ImageInfo) -> Sel... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/mouse.rs | yazi-plugin/src/bindings/mouse.rs | use std::ops::Deref;
use crossterm::event::MouseButton;
use mlua::{UserData, UserDataFields};
#[derive(Clone, Copy)]
pub struct MouseEvent(crossterm::event::MouseEvent);
impl Deref for MouseEvent {
type Target = crossterm::event::MouseEvent;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl From<crossterm::eve... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/layer.rs | yazi-plugin/src/bindings/layer.rs | use mlua::{MetaMethod, UserData};
#[derive(Clone, Copy)]
pub struct Layer(yazi_shared::Layer);
impl From<yazi_shared::Layer> for Layer {
fn from(event: yazi_shared::Layer) -> Self { Self(event) }
}
impl UserData for Layer {
fn add_methods<M: mlua::UserDataMethods<Self>>(methods: &mut M) {
methods.add_meta_method... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/mod.rs | yazi-plugin/src/bindings/mod.rs | yazi_macro::mod_flat!(calculator chan image input layer mouse range);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/calculator.rs | yazi-plugin/src/bindings/calculator.rs | use mlua::{IntoLuaMulti, UserData, UserDataMethods, Value};
use yazi_binding::Error;
pub enum SizeCalculator {
Local(yazi_fs::provider::local::SizeCalculator),
Remote(yazi_vfs::provider::SizeCalculator),
}
impl UserData for SizeCalculator {
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M) {
methods.add_... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/bindings/input.rs | yazi-plugin/src/bindings/input.rs | use std::pin::Pin;
use mlua::{UserData, prelude::LuaUserDataMethods};
use tokio::pin;
use tokio_stream::StreamExt;
use yazi_shared::errors::InputError;
pub struct InputRx<T: StreamExt<Item = Result<String, InputError>>> {
inner: T,
}
impl<T: StreamExt<Item = Result<String, InputError>>> InputRx<T> {
pub fn new(inn... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/theme/theme.rs | yazi-plugin/src/theme/theme.rs | use mlua::{IntoLua, Lua, Value};
use yazi_binding::{Composer, ComposerGet, ComposerSet, Style, Url, deprecate};
use yazi_config::THEME;
pub fn compose() -> Composer<ComposerGet, ComposerSet> {
fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> {
match key {
b"app" => app(),
b"mgr" => mgr(),
b"tabs" => ta... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/theme/mod.rs | yazi-plugin/src/theme/mod.rs | yazi_macro::mod_flat!(theme);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/preload.rs | yazi-plugin/src/isolate/preload.rs | use mlua::{ExternalError, ExternalResult, HookTriggers, IntoLua, ObjectLike, VmState};
use tokio::{runtime::Handle, select};
use tokio_util::sync::CancellationToken;
use yazi_binding::{Error, File, elements::Rect};
use yazi_config::LAYOUT;
use yazi_dds::Sendable;
use yazi_shared::event::Cmd;
use super::slim_lua;
use c... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/peek.rs | yazi-plugin/src/isolate/peek.rs | use mlua::{ExternalError, HookTriggers, IntoLua, ObjectLike, VmState};
use tokio::{runtime::Handle, select};
use tokio_util::sync::CancellationToken;
use tracing::error;
use yazi_binding::{Error, File, elements::{Rect, Renderable}};
use yazi_config::LAYOUT;
use yazi_dds::Sendable;
use yazi_parser::{app::{PluginCallback... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/fetch.rs | yazi-plugin/src/isolate/fetch.rs | use mlua::{ExternalResult, FromLua, IntoLua, Lua, ObjectLike, Value};
use tokio::runtime::Handle;
use yazi_binding::{Error, File};
use yazi_dds::Sendable;
use yazi_shared::event::CmdCow;
use super::slim_lua;
use crate::loader::LOADER;
pub async fn fetch(
cmd: CmdCow,
files: Vec<yazi_fs::File>,
) -> mlua::Result<(Fe... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/mod.rs | yazi-plugin/src/isolate/mod.rs | yazi_macro::mod_flat!(entry fetch isolate peek preload seek spot);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/isolate.rs | yazi-plugin/src/isolate/isolate.rs | use mlua::{IntoLua, Lua};
use yazi_binding::Runtime;
use yazi_macro::plugin_preset as preset;
pub fn slim_lua(name: &str) -> mlua::Result<Lua> {
let lua = Lua::new();
lua.set_app_data(Runtime::new_isolate(name));
// Base
let globals = lua.globals();
globals.raw_set("ui", crate::elements::compose())?;
globals.ra... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/spot.rs | yazi-plugin/src/isolate/spot.rs | use mlua::{ExternalError, ExternalResult, HookTriggers, IntoLua, ObjectLike, VmState};
use tokio::{runtime::Handle, select};
use tokio_util::sync::CancellationToken;
use tracing::error;
use yazi_binding::{File, Id};
use yazi_dds::Sendable;
use yazi_shared::{Ids, event::Cmd, pool::Symbol};
use super::slim_lua;
use crat... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/seek.rs | yazi-plugin/src/isolate/seek.rs | use mlua::{IntoLua, ObjectLike};
use yazi_binding::{File, elements::Rect};
use yazi_config::LAYOUT;
use yazi_parser::app::{PluginCallback, PluginOpt};
use yazi_proxy::AppProxy;
use yazi_shared::event::Cmd;
pub fn seek_sync(cmd: &'static Cmd, file: yazi_fs::File, units: i16) {
let cb: PluginCallback = Box::new(move |l... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/isolate/entry.rs | yazi-plugin/src/isolate/entry.rs | use mlua::{ExternalResult, ObjectLike};
use tokio::runtime::Handle;
use yazi_dds::Sendable;
use yazi_parser::app::PluginOpt;
use super::slim_lua;
use crate::loader::LOADER;
pub async fn entry(opt: PluginOpt) -> mlua::Result<()> {
LOADER.ensure(&opt.id, |_| ()).await.into_lua_err()?;
tokio::task::spawn_blocking(mov... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/fs/op.rs | yazi-plugin/src/fs/op.rs | use mlua::{IntoLua, Lua, Table};
use yazi_binding::{Cha, File, Id, Path, Url};
pub(super) struct FilesOp(yazi_fs::FilesOp);
impl FilesOp {
pub(super) fn part(_: &Lua, t: Table) -> mlua::Result<Self> {
let id: Id = t.raw_get("id")?;
let url: Url = t.raw_get("url")?;
let files: Table = t.raw_get("files")?;
Ok... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/fs/fs.rs | yazi-plugin/src/fs/fs.rs | use std::str::FromStr;
use mlua::{ExternalError, Function, IntoLua, IntoLuaMulti, Lua, Table, Value};
use yazi_binding::{Cha, Composer, ComposerGet, ComposerSet, Error, File, Url, UrlRef};
use yazi_config::Pattern;
use yazi_fs::{mounts::PARTITIONS, provider::{Attrs, DirReader, FileHolder}};
use yazi_shared::url::{UrlC... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/fs/mod.rs | yazi-plugin/src/fs/mod.rs | yazi_macro::mod_flat!(fs op);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/lib.rs | yazi-widgets/src/lib.rs | yazi_macro::mod_pub!(input);
yazi_macro::mod_flat!(clipboard scrollable);
pub fn init() { CLIPBOARD.with(<_>::default); }
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/scrollable.rs | yazi-widgets/src/scrollable.rs | use yazi_parser::Step;
pub trait Scrollable {
fn total(&self) -> usize;
fn limit(&self) -> usize;
fn scrolloff(&self) -> usize { self.limit() / 2 }
fn cursor_mut(&mut self) -> &mut usize;
fn offset_mut(&mut self) -> &mut usize;
fn scroll(&mut self, step: impl Into<Step>) -> bool {
let new = step.into().add(*s... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/clipboard.rs | yazi-widgets/src/clipboard.rs | use parking_lot::Mutex;
use yazi_shared::RoCell;
pub static CLIPBOARD: RoCell<Clipboard> = RoCell::new();
#[derive(Default)]
pub struct Clipboard {
content: Mutex<Vec<u8>>,
}
impl Clipboard {
#[cfg(unix)]
pub async fn get(&self) -> Vec<u8> {
use tokio::process::Command;
use yazi_shared::in_ssh_connection;
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/op.rs | yazi-widgets/src/input/op.rs | use std::ops::Range;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum InputOp {
#[default]
None,
Select(usize),
Delete(bool, bool, usize), // cut, insert, start
Yank(usize),
}
impl InputOp {
#[inline]
pub(super) fn start(&self) -> Option<usize> {
match self {
Self::None => None,
Self::Sel... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/widget.rs | yazi-widgets/src/input/widget.rs | use std::ops::Range;
use ratatui::{layout::Rect, text::Line, widgets::Widget};
use yazi_config::THEME;
use super::Input;
impl Widget for &Input {
fn render(self, area: ratatui::layout::Rect, buf: &mut ratatui::buffer::Buffer)
where
Self: Sized,
{
yazi_binding::elements::Clear::default().render(area, buf);
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/mod.rs | yazi-widgets/src/input/mod.rs | yazi_macro::mod_pub!(commands);
yazi_macro::mod_flat!(input mode op snap snaps widget);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/snaps.rs | yazi-widgets/src/input/snaps.rs | use std::mem;
use super::InputSnap;
#[derive(PartialEq, Eq)]
pub struct InputSnaps {
idx: usize,
versions: Vec<InputSnap>,
current: InputSnap,
}
impl Default for InputSnaps {
fn default() -> Self {
Self {
idx: 0,
versions: vec![InputSnap::new(String::new(), false, 0)],
current: InputSnap::... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/mode.rs | yazi-widgets/src/input/mode.rs | #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum InputMode {
Normal,
#[default]
Insert,
Replace,
}
impl InputMode {
#[inline]
pub(super) fn delta(&self) -> usize { (*self != Self::Insert) as usize }
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/snap.rs | yazi-widgets/src/input/snap.rs | use std::ops::Range;
use unicode_width::{UnicodeWidthChar, UnicodeWidthStr};
use super::{InputMode, InputOp};
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct InputSnap {
pub value: String,
pub op: InputOp,
pub mode: InputMode,
pub obscure: bool,
pub offset: usize,
pub cursor: usize,
}
impl In... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/input.rs | yazi-widgets/src/input/input.rs | use std::{borrow::Cow, ops::Range};
use crossterm::cursor::SetCursorStyle;
use yazi_config::YAZI;
use super::{InputSnap, InputSnaps, mode::InputMode, op::InputOp};
use crate::CLIPBOARD;
pub type InputCallback = Box<dyn Fn(&str, &str)>;
#[derive(Default)]
pub struct Input {
pub snaps: InputSnaps,
pub limit: ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/complete.rs | yazi-widgets/src/input/commands/complete.rs | use std::path::MAIN_SEPARATOR_STR;
use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::CompleteOpt;
use yazi_shared::data::Data;
use crate::input::Input;
#[cfg(windows)]
const SEPARATOR: [char; 2] = ['/', '\\'];
#[cfg(not(windows))]
const SEPARATOR: char = std::path::MAIN_SEPARATOR;
im... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/move.rs | yazi-widgets/src/input/commands/move.rs | use anyhow::Result;
use yazi_macro::{render, succ};
use yazi_parser::input::MoveOpt;
use yazi_shared::data::Data;
use crate::input::{Input, op::InputOp, snap::InputSnap};
impl Input {
pub fn r#move(&mut self, opt: MoveOpt) -> Result<Data> {
let snap = self.snap();
if opt.in_operating && snap.op == InputOp::None ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/casefy.rs | yazi-widgets/src/input/commands/casefy.rs | use std::ops::Range;
use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::CasefyOpt;
use yazi_shared::data::Data;
use crate::input::{Input, op::InputOp};
impl Input {
pub fn casefy(&mut self, opt: CasefyOpt) -> Result<Data> {
let snap = self.snap_mut();
if !matches!(snap.op, InputOp:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/insert.rs | yazi-widgets/src/input/commands/insert.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::InsertOpt;
use yazi_shared::data::Data;
use crate::input::{Input, InputMode, op::InputOp};
impl Input {
pub fn insert(&mut self, opt: InsertOpt) -> Result<Data> {
let snap = self.snap_mut();
if snap.mode == InputMode::Normal {
sn... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/yank.rs | yazi-widgets/src/input/commands/yank.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::VoidOpt;
use yazi_shared::data::Data;
use crate::input::{Input, op::InputOp};
impl Input {
pub fn yank(&mut self, _: VoidOpt) -> Result<Data> {
match self.snap().op {
InputOp::None => {
self.snap_mut().op = InputOp::Yank(self.snap().c... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/visual.rs | yazi-widgets/src/input/commands/visual.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::VoidOpt;
use yazi_shared::data::Data;
use crate::input::{Input, InputMode, op::InputOp};
impl Input {
pub fn visual(&mut self, _: VoidOpt) -> Result<Data> {
if self.snap().mode != InputMode::Normal {
act!(escape, self)?;
}
let snap =... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/kill.rs | yazi-widgets/src/input/commands/kill.rs | use std::ops::RangeBounds;
use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::KillOpt;
use yazi_shared::{CharKind, data::Data};
use crate::input::Input;
impl Input {
pub fn kill(&mut self, opt: KillOpt) -> Result<Data> {
let snap = self.snap_mut();
match opt.kind.as_ref() {
"all... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/backspace.rs | yazi-widgets/src/input/commands/backspace.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::BackspaceOpt;
use yazi_shared::data::Data;
use crate::input::Input;
impl Input {
pub fn backspace(&mut self, opt: BackspaceOpt) -> Result<Data> {
let snap = self.snap_mut();
if !opt.under && snap.cursor < 1 {
succ!();
} else if... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/replace.rs | yazi-widgets/src/input/commands/replace.rs | use anyhow::Result;
use yazi_macro::{render, succ};
use yazi_parser::VoidOpt;
use yazi_shared::{data::Data, replace_cow};
use crate::input::{Input, InputMode, op::InputOp};
impl Input {
pub fn replace(&mut self, _: VoidOpt) -> Result<Data> {
let snap = self.snap_mut();
if snap.mode == InputMode::Normal {
snap... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/type.rs | yazi-widgets/src/input/commands/type.rs | use anyhow::Result;
use yazi_config::keymap::Key;
use yazi_macro::{act, render, succ};
use yazi_shared::{data::Data, replace_cow};
use crate::input::{Input, InputMode};
impl Input {
pub fn r#type(&mut self, key: &Key) -> Result<bool> {
let Some(c) = key.plain() else { return Ok(false) };
if self.mode() == Input... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/paste.rs | yazi-widgets/src/input/commands/paste.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::PasteOpt;
use yazi_shared::data::Data;
use crate::{CLIPBOARD, input::{Input, op::InputOp}};
impl Input {
pub fn paste(&mut self, opt: PasteOpt) -> Result<Data> {
if let Some(start) = self.snap().op.start() {
self.snap_mut().op = In... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/undo.rs | yazi-widgets/src/input/commands/undo.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::VoidOpt;
use yazi_shared::data::Data;
use crate::input::{Input, InputMode, InputOp};
impl Input {
pub fn undo(&mut self, _: VoidOpt) -> Result<Data> {
if self.snap().op != InputOp::None {
succ!();
}
if !self.snaps.undo() {
succ!()... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/commands.rs | yazi-widgets/src/input/commands/commands.rs | use anyhow::Result;
use yazi_macro::{act, succ};
use yazi_shared::{data::Data, event::CmdCow};
use crate::input::{Input, InputMode};
impl Input {
pub fn execute(&mut self, cmd: CmdCow) -> Result<Data> {
macro_rules! on {
($name:ident) => {
if cmd.name == stringify!($name) {
return act!($name, self, cmd... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/mod.rs | yazi-widgets/src/input/commands/mod.rs | yazi_macro::mod_flat!(backspace backward casefy commands complete delete escape forward insert kill paste r#move r#type redo replace undo visual yank);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/backward.rs | yazi-widgets/src/input/commands/backward.rs | use anyhow::Result;
use yazi_macro::{act, succ};
use yazi_parser::input::BackwardOpt;
use yazi_shared::{CharKind, data::Data};
use crate::input::Input;
impl Input {
pub fn backward(&mut self, opt: BackwardOpt) -> Result<Data> {
let snap = self.snap();
if snap.cursor == 0 {
return act!(r#move, self);
}
le... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/redo.rs | yazi-widgets/src/input/commands/redo.rs | use anyhow::Result;
use yazi_macro::{act, render};
use yazi_parser::VoidOpt;
use yazi_shared::data::Data;
use crate::input::Input;
impl Input {
pub fn redo(&mut self, _: VoidOpt) -> Result<Data> {
render!(self.snaps.redo());
act!(r#move, self)
}
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/escape.rs | yazi-widgets/src/input/commands/escape.rs | use anyhow::Result;
use yazi_macro::{act, succ};
use yazi_parser::VoidOpt;
use yazi_shared::data::Data;
use crate::input::{Input, InputMode, op::InputOp};
impl Input {
pub fn escape(&mut self, _: VoidOpt) -> Result<Data> {
let snap = self.snap_mut();
match snap.mode {
InputMode::Normal => {
snap.op = Inpu... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/forward.rs | yazi-widgets/src/input/commands/forward.rs | use anyhow::Result;
use yazi_macro::act;
use yazi_parser::input::ForwardOpt;
use yazi_shared::{CharKind, data::Data};
use crate::input::{Input, op::InputOp};
impl Input {
pub fn forward(&mut self, opt: ForwardOpt) -> Result<Data> {
let snap = self.snap();
let mut it = snap.value.chars().skip(snap.cursor).enumer... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-widgets/src/input/commands/delete.rs | yazi-widgets/src/input/commands/delete.rs | use anyhow::Result;
use yazi_macro::{act, render, succ};
use yazi_parser::input::DeleteOpt;
use yazi_shared::data::Data;
use crate::input::{Input, op::InputOp};
impl Input {
pub fn delete(&mut self, opt: DeleteOpt) -> Result<Data> {
match self.snap().op {
InputOp::None => {
self.snap_mut().op = InputOp::Del... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/op.rs | yazi-vfs/src/op.rs | use yazi_fs::FilesOp;
use yazi_shared::url::{UrlBuf, UrlLike};
use crate::maybe_exists;
pub trait VfsFilesOp {
fn issue_error(cwd: &UrlBuf, kind: impl Into<yazi_fs::error::Error>) -> impl Future<Output = ()>;
}
impl VfsFilesOp for FilesOp {
async fn issue_error(cwd: &UrlBuf, err: impl Into<yazi_fs::error::Error>) ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/lib.rs | yazi-vfs/src/lib.rs | yazi_macro::mod_pub!(provider);
yazi_macro::mod_flat!(cha file files fns op);
pub fn init() { provider::init(); }
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/file.rs | yazi-vfs/src/file.rs | use anyhow::Result;
use yazi_fs::{File, cha::Cha};
use yazi_shared::url::{UrlBuf, UrlCow};
use crate::{VfsCha, provider};
pub trait VfsFile: Sized {
fn new<'a>(url: impl Into<UrlCow<'a>>) -> impl Future<Output = Result<Self>>;
fn from_follow(url: UrlBuf, cha: Cha) -> impl Future<Output = Self>;
}
impl VfsFile for... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/files.rs | yazi-vfs/src/files.rs | use std::io;
use tokio::{select, sync::mpsc::{self, UnboundedReceiver}};
use yazi_fs::{File, Files, FilesOp, cha::Cha, mounts::PARTITIONS, provider::{DirReader, FileHolder}};
use yazi_shared::url::UrlBuf;
use crate::{VfsCha, VfsFile, VfsFilesOp, provider::{self, DirEntry}};
pub trait VfsFiles {
fn from_dir(dir: &Ur... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/cha.rs | yazi-vfs/src/cha.rs | use std::io;
use yazi_fs::cha::{Cha, ChaKind};
use yazi_shared::url::AsUrl;
use crate::provider;
pub trait VfsCha: Sized {
fn from_url(url: impl AsUrl) -> impl Future<Output = io::Result<Self>>;
fn from_follow<U>(url: U, cha: Self) -> impl Future<Output = Self>
where
U: AsUrl;
}
impl VfsCha for Cha {
#[inlin... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/fns.rs | yazi-vfs/src/fns.rs | use std::io::{self};
use yazi_macro::ok_or_not_found;
use yazi_shared::{strand::{StrandBuf, StrandLike}, url::{AsUrl, UrlBuf, UrlLike}};
use crate::provider;
#[inline]
pub async fn maybe_exists(url: impl AsUrl) -> bool {
match provider::symlink_metadata(url).await {
Ok(_) => true,
Err(e) => e.kind() != io::Erro... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/gate.rs | yazi-vfs/src/provider/gate.rs | use std::io;
use yazi_fs::provider::{Attrs, FileBuilder};
use yazi_shared::{scheme::SchemeKind, url::AsUrl};
#[derive(Clone, Copy, Default)]
pub struct Gate {
pub(super) append: bool,
pub(super) attrs: Attrs,
pub(super) create: bool,
pub(super) create_new: bool,
pub(super) read: bool,
pub(sup... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/dir_entry.rs | yazi-vfs/src/provider/dir_entry.rs | use std::io;
use yazi_fs::{cha::{Cha, ChaType}, provider::FileHolder};
use yazi_shared::{path::PathBufDyn, strand::StrandCow, url::UrlBuf};
pub enum DirEntry {
Local(yazi_fs::provider::local::DirEntry),
Sftp(super::sftp::DirEntry),
}
impl FileHolder for DirEntry {
async fn file_type(&self) -> io::Result<ChaType> ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/mod.rs | yazi-vfs/src/provider/mod.rs | yazi_macro::mod_pub!(sftp);
yazi_macro::mod_flat!(calculator copier dir_entry gate provider providers read_dir rw_file);
pub(super) fn init() { sftp::init(); }
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/copier.rs | yazi-vfs/src/provider/copier.rs | use std::{io::{self, SeekFrom}, sync::{Arc, atomic::{AtomicU64, Ordering}}};
use futures::{StreamExt, TryStreamExt};
use tokio::{io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt, BufReader, BufWriter}, select, sync::{mpsc, oneshot}};
use yazi_fs::provider::{Attrs, FileBuilder};
use yazi_shared::url::{Url, UrlBuf};
use ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/rw_file.rs | yazi-vfs/src/provider/rw_file.rs | use std::{io, pin::Pin};
use tokio::io::{AsyncRead, AsyncSeek, AsyncWrite};
use yazi_fs::provider::Attrs;
pub enum RwFile {
Tokio(tokio::fs::File),
Sftp(Box<yazi_sftp::fs::File>),
}
impl From<tokio::fs::File> for RwFile {
fn from(f: tokio::fs::File) -> Self { Self::Tokio(f) }
}
impl From<yazi_sftp::fs::File> for... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/read_dir.rs | yazi-vfs/src/provider/read_dir.rs | use std::io;
use yazi_fs::provider::DirReader;
pub enum ReadDir {
Local(yazi_fs::provider::local::ReadDir),
Sftp(super::sftp::ReadDir),
}
impl DirReader for ReadDir {
type Entry = super::DirEntry;
async fn next(&mut self) -> io::Result<Option<Self::Entry>> {
Ok(match self {
Self::Local(reader) => reader.ne... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/provider.rs | yazi-vfs/src/provider/provider.rs | use std::io;
use tokio::sync::mpsc;
use yazi_fs::{cha::Cha, provider::{Attrs, Capabilities, Provider, local::Local}};
use yazi_shared::{path::PathBufDyn, strand::AsStrand, url::{AsUrl, Url, UrlBuf, UrlCow}};
use super::{Providers, ReadDir, RwFile};
pub async fn absolute<'a, U>(url: &'a U) -> io::Result<UrlCow<'a>>
w... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/providers.rs | yazi-vfs/src/provider/providers.rs | use std::io;
use tokio::sync::mpsc;
use yazi_fs::{cha::Cha, provider::{Attrs, Capabilities, Provider}};
use yazi_shared::{path::{AsPath, PathBufDyn}, strand::AsStrand, url::{Url, UrlBuf, UrlCow}};
#[derive(Clone)]
pub(super) enum Providers<'a> {
Local(yazi_fs::provider::local::Local<'a>),
Sftp(super::sftp::Sftp<'a>... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/calculator.rs | yazi-vfs/src/provider/calculator.rs | use std::{collections::VecDeque, io, time::{Duration, Instant}};
use yazi_fs::provider::{DirReader, FileHolder};
use yazi_shared::{Either, url::{AsUrl, UrlBuf}};
use super::ReadDir;
pub enum SizeCalculator {
File(Option<u64>),
Dir(VecDeque<Either<UrlBuf, ReadDir>>),
}
impl SizeCalculator {
pub async fn new<U>(ur... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/absolute.rs | yazi-vfs/src/provider/sftp/absolute.rs | use yazi_fs::CWD;
use yazi_shared::url::{UrlCow, UrlLike};
pub fn try_absolute<'a, U>(url: U) -> Option<UrlCow<'a>>
where
U: Into<UrlCow<'a>>,
{
try_absolute_impl(url.into())
}
fn try_absolute_impl<'a>(url: UrlCow<'a>) -> Option<UrlCow<'a>> {
if url.is_absolute() {
Some(url)
} else if let cwd = CWD.load()
&& ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/gate.rs | yazi-vfs/src/provider/sftp/gate.rs | use std::io;
use yazi_config::vfs::{ServiceSftp, Vfs};
use yazi_fs::provider::{Attrs, FileBuilder};
use yazi_sftp::fs::Flags;
use yazi_shared::url::{AsUrl, Url};
use crate::provider::sftp::Conn;
#[derive(Clone, Copy, Default)]
pub struct Gate(crate::provider::Gate);
impl From<Gate> for Flags {
fn from(Gate(g): Gat... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/conn.rs | yazi-vfs/src/provider/sftp/conn.rs | use std::{io, sync::Arc, time::Duration};
use russh::keys::PrivateKeyWithHashAlg;
use yazi_config::vfs::ServiceSftp;
use yazi_fs::provider::local::Local;
#[derive(Clone, Copy)]
pub(super) struct Conn {
pub(super) name: &'static str,
pub(super) config: &'static ServiceSftp,
}
impl russh::client::Handler for Conn ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/sftp.rs | yazi-vfs/src/provider/sftp/sftp.rs | use std::{io, sync::Arc};
use tokio::{io::{AsyncWriteExt, BufReader, BufWriter}, sync::mpsc::Receiver};
use yazi_config::vfs::{ServiceSftp, Vfs};
use yazi_fs::provider::{Capabilities, DirReader, FileHolder, Provider};
use yazi_sftp::fs::{Attrs, Flags};
use yazi_shared::{loc::LocBuf, path::{AsPath, PathBufDyn}, pool::I... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/mod.rs | yazi-vfs/src/provider/sftp/mod.rs | yazi_macro::mod_flat!(absolute conn gate metadata read_dir sftp);
static CONN: yazi_shared::RoCell<
parking_lot::Mutex<
hashbrown::HashMap<
&'static yazi_config::vfs::ServiceSftp,
&'static deadpool::managed::Pool<Conn>,
>,
>,
> = yazi_shared::RoCell::new();
pub(super) fn init() { CONN.init(Default::defaul... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/read_dir.rs | yazi-vfs/src/provider/sftp/read_dir.rs | use std::{io, sync::Arc};
use yazi_fs::provider::{DirReader, FileHolder};
use yazi_shared::{path::PathBufDyn, strand::StrandCow, url::{UrlBuf, UrlLike}};
use super::{Cha, ChaMode};
pub struct ReadDir {
pub(super) dir: Arc<UrlBuf>,
pub(super) reader: yazi_sftp::fs::ReadDir,
}
impl DirReader for ReadDir {
type ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-vfs/src/provider/sftp/metadata.rs | yazi-vfs/src/provider/sftp/metadata.rs | use std::{io, time::{Duration, UNIX_EPOCH}};
use yazi_fs::cha::ChaKind;
// --- Attrs
pub(crate) struct Attrs(pub(crate) yazi_fs::provider::Attrs);
impl TryFrom<Attrs> for yazi_sftp::fs::Attrs {
type Error = ();
fn try_from(value: Attrs) -> Result<Self, Self::Error> {
let attrs = Self {
size: None,
uid... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/lib.rs | yazi-parser/src/lib.rs | yazi_macro::mod_pub!(app cmp confirm help input mgr notify pick spot tasks which);
yazi_macro::mod_flat!(arrow step void);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/void.rs | yazi-parser/src/void.rs | use mlua::{FromLua, IntoLua, Lua, Value};
use yazi_shared::event::CmdCow;
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct VoidOpt;
impl From<CmdCow> for VoidOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for VoidOpt {
fn from(_: ()) -> Self { Self }
}
impl FromLua for VoidOpt {
fn fro... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/arrow.rs | yazi-parser/src/arrow.rs | use anyhow::bail;
use mlua::{ExternalError, IntoLua, Lua, Value};
use yazi_shared::event::CmdCow;
use crate::Step;
#[derive(Clone, Copy, Debug, Default)]
pub struct ArrowOpt {
pub step: Step,
}
impl TryFrom<CmdCow> for ArrowOpt {
type Error = anyhow::Error;
fn try_from(c: CmdCow) -> Result<Self, Self::Error> {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/step.rs | yazi-parser/src/step.rs | use std::{num::ParseIntError, str::FromStr};
use yazi_shared::data::Data;
#[derive(Clone, Copy, Debug)]
pub enum Step {
Top,
Bot,
Prev,
Next,
Offset(isize),
Percent(i8),
}
impl Default for Step {
fn default() -> Self { Self::Offset(0) }
}
impl From<isize> for Step {
fn from(n: isize) -> Self { Self::Offset(... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/tasks/update_succeed.rs | yazi-parser/src/tasks/update_succeed.rs | use anyhow::bail;
use mlua::{ExternalError, FromLua, IntoLua, Lua, Value};
use yazi_shared::{event::CmdCow, url::UrlBuf};
#[derive(Debug)]
pub struct UpdateSucceedOpt {
pub urls: Vec<UrlBuf>,
}
impl TryFrom<CmdCow> for UpdateSucceedOpt {
type Error = anyhow::Error;
fn try_from(mut c: CmdCow) -> Result<Self, Self:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/tasks/process_open.rs | yazi-parser/src/tasks/process_open.rs | use std::ffi::OsString;
use anyhow::anyhow;
use mlua::{ExternalError, FromLua, IntoLua, Lua, Value};
use yazi_shared::{CompletionToken, event::CmdCow, url::UrlCow};
// --- Exec
#[derive(Debug)]
pub struct ProcessOpenOpt {
pub cwd: UrlCow<'static>,
pub cmd: OsString,
pub args: Vec<UrlCow<'static>>,
pub blo... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/tasks/mod.rs | yazi-parser/src/tasks/mod.rs | yazi_macro::mod_flat!(process_open update_succeed);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/notify.rs | yazi-parser/src/app/notify.rs | use std::{str::FromStr, time::Duration};
use anyhow::anyhow;
use mlua::{ExternalError, ExternalResult};
use serde::Deserialize;
use yazi_config::{Style, THEME};
use yazi_shared::event::CmdCow;
pub struct NotifyOpt {
pub title: String,
pub content: String,
pub level: NotifyLevel,
pub timeout: Duration,
}
impl... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/update_progress.rs | yazi-parser/src/app/update_progress.rs | use anyhow::bail;
use ordered_float::OrderedFloat;
use serde::Serialize;
use yazi_shared::event::CmdCow;
pub struct UpdateProgressOpt {
pub summary: TaskSummary,
}
impl TryFrom<CmdCow> for UpdateProgressOpt {
type Error = anyhow::Error;
fn try_from(mut c: CmdCow) -> Result<Self, Self::Error> {
let Some(summary)... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/mouse.rs | yazi-parser/src/app/mouse.rs | use crossterm::event::MouseEvent;
pub struct MouseOpt {
pub event: MouseEvent,
}
impl From<MouseEvent> for MouseOpt {
fn from(event: MouseEvent) -> Self { Self { event } }
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/deprecate.rs | yazi-parser/src/app/deprecate.rs | use anyhow::bail;
use yazi_shared::{SStr, event::CmdCow};
pub struct DeprecateOpt {
pub content: SStr,
}
impl TryFrom<CmdCow> for DeprecateOpt {
type Error = anyhow::Error;
fn try_from(mut c: CmdCow) -> Result<Self, Self::Error> {
let Ok(content) = c.take("content") else {
bail!("Invalid 'content' in Depreca... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/mod.rs | yazi-parser/src/app/mod.rs | yazi_macro::mod_flat!(deprecate mouse notify plugin resume stop update_progress);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/resume.rs | yazi-parser/src/app/resume.rs | use tokio::sync::oneshot;
use yazi_shared::event::CmdCow;
pub struct ResumeOpt {
pub tx: Option<oneshot::Sender<()>>,
}
impl From<CmdCow> for ResumeOpt {
fn from(mut c: CmdCow) -> Self { Self { tx: c.take_any("tx") } }
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/stop.rs | yazi-parser/src/app/stop.rs | use tokio::sync::oneshot;
use yazi_shared::event::CmdCow;
pub struct StopOpt {
pub tx: Option<oneshot::Sender<()>>,
}
impl From<CmdCow> for StopOpt {
fn from(mut c: CmdCow) -> Self { Self { tx: c.take_any("tx") } }
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-parser/src/app/plugin.rs | yazi-parser/src/app/plugin.rs | use std::{borrow::Cow, fmt::Debug, str::FromStr};
use anyhow::bail;
use hashbrown::HashMap;
use mlua::{Lua, Table};
use serde::Deserialize;
use yazi_shared::{SStr, data::{Data, DataKey}, event::{Cmd, CmdCow}};
pub type PluginCallback = Box<dyn FnOnce(&Lua, Table) -> mlua::Result<()> + Send + Sync>;
#[derive(Default)... | 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.