Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/VivekPanyam/lunchbox
/ functions
Functions
98 in github.com/VivekPanyam/lunchbox
⨍
Functions
98
◇
Types & classes
23
↓ 24 callers
Method
with_base_dir
Add the base dir when taking paths as input
src/chroot.rs:115
↓ 22 callers
Method
to_std_path
(&self, path: impl AsRef<LunchboxPath>)
src/localfs.rs:133
↓ 21 callers
Method
get
(&self)
src/chroot.rs:64
↓ 4 callers
Method
create
Sets the option to create a new file, or open it if it already exists. In order for the file to be created, [`OpenOptions::write`] or [`OpenOptions::
src/types.rs:1197
↓ 4 callers
Method
file_type
Returns the file type for the file that this entry points at. This function will not traverse symlinks if this entry points at a symlink. # Example
src/types.rs:573
↓ 4 callers
Method
from_std_path
(&self, path: impl AsRef<StdPath>)
src/localfs.rs:152
↓ 4 callers
Method
open
(&self, path: impl PathType)
src/localfs.rs:213
↓ 3 callers
Method
metadata
Equivalent to ``` async fn metadata(&self, fs: &impl ReadableFileSystem) -> std::io::Result<Metadata>; ``` An alias for [`fs.metadata(self)`](Readabl
src/path.rs:53
↓ 3 callers
Method
path
Returns the full path to the file that this entry represents. The full path may be created by joining the original path to `read_dir` with the filena
src/types.rs:549
↓ 3 callers
Method
strip_base_dir
Remove the base dir when returning paths
src/chroot.rs:93
↓ 2 callers
Method
file_name
Returns the bare file name of this directory entry without any other leading path component. # Examples ```no_run let mut entries = fs.read_dir(".")
src/types.rs:520
↓ 2 callers
Method
is_dir
Tests whether this file type represents a directory. The result is mutually exclusive to the results of [`is_file`] and [`is_symlink`]; only zero or o
src/types.rs:710
↓ 2 callers
Method
permissions
Returns the permissions of the file this metadata is for. # Examples ```no_run let metadata = fs.metadata("foo.txt").await?; assert!(!metadata.perm
src/types.rs:959
↓ 2 callers
Method
readonly
Returns true if these permissions describe a readonly (unwritable) file. See the docs for individual filesystem implementations to see how they handl
src/types.rs:995
↓ 2 callers
Method
truncate
Sets the option for truncating a previous file. If a file is successfully opened with this option set it will truncate the file to 0 length if it alr
src/types.rs:1180
↓ 1 callers
Method
accessed
Returns the last access time of this metadata. Note that not all platforms will keep this field update in a file's metadata. # Errors This field mi
src/types.rs:814
↓ 1 callers
Method
append
Sets the option for the append mode. This option, when true, means that writes will append to a file instead of overwriting previous contents. Note t
src/types.rs:1161
↓ 1 callers
Method
create_new
Sets the option to create a new file, failing if it already exists. No file is allowed to exist at the target location, also no (dangling) symlink. I
src/types.rs:1229
↓ 1 callers
Method
created
Returns the creation time listed in this metadata. # Errors This field might not be available on all platforms, and will return an `Err` on platfor
src/types.rs:840
↓ 1 callers
Method
into_poller
(self)
src/types.rs:679
↓ 1 callers
Method
is_file
Tests whether this file type represents a regular file. The result is mutually exclusive to the results of [`is_dir`] and [`is_symlink`]; only zero o
src/types.rs:725
↓ 1 callers
Method
is_symlink
Tests whether this file type represents a symbolic link. The result is mutually exclusive to the results of [`is_dir`] and [`is_file`]; only zero or o
src/types.rs:743
↓ 1 callers
Method
len
Returns the size of the file, in bytes, this metadata is for. # Examples ```no_run let metadata = fs.metadata("foo.txt").await?; assert_eq!(0, meta
src/types.rs:946
↓ 1 callers
Method
metadata
Returns the metadata for the file that this entry points at. This function will not traverse symlinks if this entry points at a symlink. This functi
src/types.rs:598
↓ 1 callers
Method
modified
Returns the last modification time listed in this metadata. # Errors This field might not be available on all platforms, and will return an `Err` o
src/types.rs:866
↓ 1 callers
Method
open
Opens a file at `path` with the options specified by `self`. # Errors This function will return an error under a number of different circumstances.
src/types.rs:1276
↓ 1 callers
Method
open
(&self, path: impl PathType)
src/chroot.rs:152
↓ 1 callers
Method
open_with_opts
( &self, opts: &OpenOptions, path: impl PathType, )
src/chroot.rs:257
↓ 1 callers
Method
poll_next_entry
( &mut self, cx: &mut std::task::Context<'_>, fs: &'a ChrootFS<T>, )
src/chroot.rs:224
↓ 1 callers
Method
read
(&self, path: impl PathType)
src/localfs.rs:232
↓ 1 callers
Method
read_to_string
(&self, path: impl PathType)
src/chroot.rs:200
↓ 1 callers
Method
read_to_string
(&self, path: impl PathType)
src/localfs.rs:266
↓ 1 callers
Method
set_readonly
Modifies the readonly flag for this set of permissions. If the `readonly` argument is `true`, using the resulting `Permission` will update file permis
src/types.rs:1011
↓ 1 callers
Method
symlink_metadata
(&self, path: impl PathType)
src/chroot.rs:205
↓ 1 callers
Method
symlink_metadata
Equivalent to ``` async fn symlink_metadata(&self, fs: &impl ReadableFileSystem) -> std::io::Result<Metadata>; ``` An alias for [`fs.symlink_metadata
src/path.rs:72
↓ 1 callers
Method
write
Sets the option for write access. This option, when true, will indicate that the file should be `write`-able if opened. If the file already exists,
src/types.rs:1117
↓ 1 callers
Method
write
(&self, path: impl PathType, contents: impl AsRef<[u8]> + Send)
src/localfs.rs:408
Method
canonicalize
(&self, path: impl PathType)
src/chroot.rs:160
Method
canonicalize
Equivalent to ``` async fn canonicalize(&self, fs: &impl ReadableFileSystem) -> std::io::Result<PathBuf>; ``` An alias for [`fs.canonicalize(self)`](
src/path.rs:91
Method
canonicalize
(&self, path: impl PathType)
src/localfs.rs:220
Method
copy
(&self, from: impl PathType, to: impl PathType)
src/chroot.rs:271
Method
copy
(&self, from: impl PathType, to: impl PathType)
src/localfs.rs:336
Method
create
Equivalent to ``` async fn create(&self, path: impl PathType) -> Result<Self::FileType> where Self::FileType: WritableFile; ``` Opens a file in write-
src/types.rs:212
Method
create_dir
(&self, path: impl PathType)
src/chroot.rs:278
Method
create_dir
(&self, path: impl PathType)
src/localfs.rs:344
Method
create_dir_all
(&self, path: impl PathType)
src/chroot.rs:284
Method
create_dir_all
(&self, path: impl PathType)
src/localfs.rs:351
Method
exists
(&self, fs: &(impl ReadableFileSystem + MaybeSync))
src/path.rs:167
Method
from
(value: std::fs::FileType)
src/types.rs:749
Method
hard_link
(&self, src: impl PathType, dst: impl PathType)
src/chroot.rs:290
Method
hard_link
(&self, src: impl PathType, dst: impl PathType)
src/localfs.rs:358
Method
is_dir
(&self, fs: &(impl ReadableFileSystem + MaybeSync))
src/path.rs:232
Method
is_file
(&self, fs: &(impl ReadableFileSystem + MaybeSync))
src/path.rs:198
Method
is_symlink
(&self, fs: &(impl ReadableFileSystem + MaybeSync))
src/path.rs:267
Function
main
Replace inline code blocks in the README with links when generating docs
build.rs:23
Method
metadata
(&self, path: impl PathType)
src/chroot.rs:167
Method
metadata
(&self)
src/localfs.rs:177
Method
new
(fs: &'a F, file_name: String, path: PathBuf)
src/types.rs:500
Method
new
(inner: T, base_dir: PathBuf)
src/chroot.rs:88
Method
new
Create a new LocalFS using the root of the filesystem (i.e. "/") as a base directory ``` use lunchbox::LocalFS; assert_eq!(LocalFS::new(), LocalFS::
src/localfs.rs:76
Method
next_entry
Returns the next entry in the directory stream.
src/types.rs:675
Method
open_with_opts
( &self, opts: &OpenOptions, path: impl PathType, )
src/localfs.rs:313
Method
poll_next_entry
( &mut self, cx: &mut std::task::Context<'_>, fs: &'a LocalFS, )
src/localfs.rs:287
Method
read
Sets the option for read access. This option, when true, will indicate that the file should be `read`-able if opened. # Examples ```no_run use lunc
src/types.rs:1097
Method
read
(&self, path: impl PathType)
src/chroot.rs:172
Method
read_dir
( &self, path: impl PathType, )
src/chroot.rs:180
Method
read_dir
Equivalent to ``` async fn read_dir<T: ReadableFileSystem>( &self, fs: &T, ) -> std::io::Result<ReadDir<T::ReadDirPollerType, T>>; ``` An alias for [
src/path.rs:132
Method
read_dir
( &self, path: impl PathType, )
src/localfs.rs:240
Method
read_link
(&self, path: impl PathType)
src/chroot.rs:193
Method
read_link
Equivalent to ``` async fn read_link(&self, fs: &impl ReadableFileSystem) -> std::io::Result<PathBuf>; ``` An alias for [`fs.read_link(self)`](Readab
src/path.rs:110
Method
read_link
(&self, path: impl PathType)
src/localfs.rs:252
Method
remove_dir
(&self, path: impl PathType)
src/chroot.rs:297
Method
remove_dir
(&self, path: impl PathType)
src/localfs.rs:366
Method
remove_dir_all
(&self, path: impl PathType)
src/chroot.rs:303
Method
remove_dir_all
(&self, path: impl PathType)
src/localfs.rs:373
Method
remove_file
(&self, path: impl PathType)
src/chroot.rs:309
Method
remove_file
(&self, path: impl PathType)
src/localfs.rs:380
Method
rename
(&self, from: impl PathType, to: impl PathType)
src/chroot.rs:315
Method
rename
(&self, from: impl PathType, to: impl PathType)
src/localfs.rs:387
Method
set_len
(&self, size: u64)
src/localfs.rs:196
Method
set_permissions
(&self, path: impl PathType, perm: Permissions)
src/chroot.rs:322
Method
set_permissions
(&self, perm: Permissions)
src/localfs.rs:200
Method
symlink
(&self, src: impl PathType, dst: impl PathType)
src/chroot.rs:328
Method
symlink
(&self, src: impl PathType, dst: impl PathType)
src/localfs.rs:400
Method
symlink_metadata
(&self, path: impl PathType)
src/localfs.rs:273
Method
sync_all
(&self)
src/localfs.rs:188
Method
sync_data
(&self)
src/localfs.rs:192
Function
test_base_dir
()
src/localfs.rs:425
Function
test_basic
()
src/localfs.rs:468
Function
test_basic_chroot
()
src/chroot.rs:391
Function
test_conversions
()
src/chroot.rs:367
Function
test_conversions
()
src/localfs.rs:440
Function
test_new
()
src/localfs.rs:434
Function
test_path_join
Ensures that joining "absolute" paths to a prefix does not overwrite the prefix
src/chroot.rs:358
Method
try_clone
(&self)
src/localfs.rs:181
Method
with_base_dir
Create a new LocalFS given a base directory path. The returned filesystem will operate within the specified directory. Returns an error if the `base_d
src/localfs.rs:95
Method
with_base_dir_unchecked
Create a new LocalFS given a base directory path. The returned filesystem will operate within the specified directory. This function DOES NOT check if
src/localfs.rs:125
Method
write
( &self, path: impl PathType, contents: impl AsRef<[u8]> + MaybeSend, )
src/chroot.rs:335