Skip to main content

ConfigFile

Trait ConfigFile 

Source
pub trait ConfigFile {
    const FILENAME: &'static str;
    const DEFAULT_MODULE: &'static str;
}
Expand description

Common behavior for configuration files.

Required Associated Constants§

Source

const FILENAME: &'static str

The filename in the configuration directory.

Source

const DEFAULT_MODULE: &'static str

The default lua module.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ConfigFile for Colors

Source§

const FILENAME: &'static str = "colors.lua"

Source§

const DEFAULT_MODULE: &'static str = "return {\n ---@param filepath string\n ---@param attributes FileAttributes\n ---@param default Color|nil\n ---@return Color|nil\n icons = function(filepath, attributes, default)\n return default\n end,\n git_statuses = {\n ---@param status GitStatus\n ---@param default Color|nil\n ---@return Color|nil\n untracked = function(status, default)\n return default\n end,\n ---@param status GitStatus\n ---@param default Color|nil\n ---@return Color|nil\n tracked = function(status, default)\n return default\n end,\n },\n}\n"

Source§

impl ConfigFile for Icons

Source§

const FILENAME: &'static str = "icons.lua"

Source§

const DEFAULT_MODULE: &'static str = "---@param filepath string Path to the file relative to the starting directory\n---@param attributes FileAttributes\n---@param default string The default icon\n---@return string|nil\nlocal function icons(filepath, attributes, default)\n return default\nend\n\nreturn icons\n"

Source§

impl ConfigFile for Main

Source§

const FILENAME: &'static str = "config.lua"

Source§

const DEFAULT_MODULE: &'static str = "return {\n ---@type \"auto\"|\"on\"|\"ansi\"|\"off\"|nil\n color = \"auto\",\n ---@param filepath string Path to the file relative to the starting directory\n ---@param attributes FileAttributes\n ---@param default boolean\n ---@return boolean\n skip = function(filepath, attributes, default)\n -- The default is to hide dotfiles on Unix and files with the hidden attribute on\n -- Windows.\n return default\n end,\n ---@type Sorting|nil\n -- When this is nil, the default sorting algorithm will be used.\n sorting = nil,\n ---@type integer|nil\n -- When this is not nil, it will set how many levels deep this tool should search in\n -- the directory tree.\n level = nil,\n}\n"