Crate fdf

Crate fdf 

Source

Modules§

printer
size_filter

Macros§

access_dirent
A helper macro to safely access dirent(64 on linux)’s fields of a libc::dirent/libc::dirent64 aka ‘dirent-type’ struct by offset.
const_from_env
Macro to create a const from an env var with compile-time parsing (Please read the docs carefully)
cstr
A macro to create a C-style *str pointer from a byte slice (does not allocate!) Returns a pointer to a null-terminated C-style *const _ (type inferred by caller, i8 or u8)
impl_bytes_storage
Macro to implement BytesStorage for types that support From<&[u8]> The types must implement From<&[u8]> to be used with this macro

Structs§

AlignedBuffer
A highly optimized, aligned buffer for system call operations
DirEntry
A struct representing a directory entry with minimal memory overhead.
Finder
A struct to find files in a directory.
FinderBuilder
A builder for creating a Finder instance with customisable options.
OsBytes
OsBytes provides a generic wrapper around byte storage types that implement the BytesStorage trait.
SearchConfig
This struct holds the configuration for searching directories.
TempDirent
A temporary directory entry used for filtering purposes. Used to avoid heap allocations.

Enums§

DirEntryError
An error type for directory entry operations.
FileType
Represents the type of a file in the filesystem

Constants§

BUFFER_SIZE
The size of the buffer used for directory entries, set to 4115 by default, but can be customised via environment variable. size of IO block
LOCAL_PATH_MAX
The maximum length of a local path, set to 4096 by default, but can be customised via environment variable.

Traits§

BytesStorage
a trait that all storage types must implement (for our main types) (so the user can use their own types if they want)
ValueType
Marker trait for valid buffer value types (i8 and u8)

Functions§

close_asm
Closes file descriptor using direct syscall
contains_zero_byte
Returns true if x contains any zero byte.
dirent_const_time_strlen
Returns the length of a dirent64::d_name string in constant time using SWAR (SIMD within a register) bit tricks.
find_char_in_word
Finds the first occurrence of a byte in a 64-bit word.
getdents_asm
Libc-based fallback for reading directory entries
glob_to_regex
Parse a shell glob-like pattern into a regular expression(String)
memrchr
Returns the last index matching the byte x in text.
open_asm
Opens a directory using libc::open
strlen
Calculates the length of a null-terminated string pointed to by ptr, Via specialised instructions, AVX2 if available, then SSE2 then libc’s strlen
unix_time_to_datetime

Type Aliases§

DirEntryFilter
generic filter function type for directory entries
FilterType
filter function type for directory entries,
Result
Generic result type for directory entry operations
SlimmerBytes
This is a type alias for a boxed slice of bytes with a slimmer size representation on Linux/macos, 10 bytes not 16