pub struct FileSystemPath {
pub fs: ResolvedVc<Box<dyn FileSystem>>,
pub path: RcStr,
}
Fields§
§fs: ResolvedVc<Box<dyn FileSystem>>
§path: RcStr
Implementations§
Source§impl FileSystemPath
impl FileSystemPath
pub fn is_inside_ref(&self, other: &FileSystemPath) -> bool
pub fn is_inside_or_equal_ref(&self, other: &FileSystemPath) -> bool
pub fn is_root(&self) -> bool
Sourcepub fn get_path_to<'a>(&self, inner: &'a FileSystemPath) -> Option<&'a str>
pub fn get_path_to<'a>(&self, inner: &'a FileSystemPath) -> Option<&'a str>
Returns the path of inner
relative to self
.
Note: this method always strips the leading /
from the result.
pub fn get_relative_path_to(&self, other: &FileSystemPath) -> Option<RcStr>
Sourcepub fn file_name(&self) -> &str
pub fn file_name(&self) -> &str
Returns the final component of the FileSystemPath, or an empty string for the root path.
pub fn extension_ref(&self) -> Option<&str>
Source§impl FileSystemPath
impl FileSystemPath
Sourcepub fn join(self: Vc<Self>, path: RcStr) -> Vc<Self>
pub fn join(self: Vc<Self>, path: RcStr) -> Vc<Self>
Adds a subpath to the current path. The /-separate path argument might contain “..” or “.” seqments, but it must not leave the root of the filesystem.
Sourcepub fn append(self: Vc<Self>, path: RcStr) -> Vc<Self>
pub fn append(self: Vc<Self>, path: RcStr) -> Vc<Self>
Adds a suffix to the filename. [path] must not contain /
.
Sourcepub fn append_to_stem(self: Vc<Self>, appending: RcStr) -> Vc<Self>
pub fn append_to_stem(self: Vc<Self>, appending: RcStr) -> Vc<Self>
Adds a suffix to the basename of the filename. [appending] must not
contain /
. Extension will stay intact.
Sourcepub fn try_join(self: Vc<Self>, path: RcStr) -> Vc<FileSystemPathOption>
pub fn try_join(self: Vc<Self>, path: RcStr) -> Vc<FileSystemPathOption>
Similar to FileSystemPath::join, but returns an Option that will be None when the joined path would leave the filesystem root.
Sourcepub fn try_join_inside(self: Vc<Self>, path: RcStr) -> Vc<FileSystemPathOption>
pub fn try_join_inside(self: Vc<Self>, path: RcStr) -> Vc<FileSystemPathOption>
Similar to FileSystemPath::join, but returns an Option that will be None when the joined path would leave the current path.
pub fn track_glob( self: Vc<Self>, glob: Vc<Glob>, include_dot_files: bool, ) -> Vc<Completion>
pub fn root(self: Vc<Self>) -> Vc<Self>
pub fn fs(self: Vc<Self>) -> Vc<Box<dyn FileSystem>>
pub fn extension(self: Vc<Self>) -> Vc<RcStr>
pub fn is_inside(self: Vc<Self>, other: Vc<FileSystemPath>) -> Vc<bool>
pub fn is_inside_or_equal(self: Vc<Self>, other: Vc<FileSystemPath>) -> Vc<bool>
Sourcepub fn with_extension(self: Vc<Self>, extension: RcStr) -> Vc<FileSystemPath>
pub fn with_extension(self: Vc<Self>, extension: RcStr) -> Vc<FileSystemPath>
Creates a new [Vc<FileSystemPath>
] like self
but with the given
extension.
Sourcepub fn file_stem(self: Vc<Self>) -> Vc<Option<RcStr>>
pub fn file_stem(self: Vc<Self>) -> Vc<Option<RcStr>>
Extracts the stem (non-extension) portion of self.file_name.
The stem is:
None
, if there is no file name;- The entire file name if there is no embedded
.
; - The entire file name if the file name begins with
.
and has no other.
s within; - Otherwise, the portion of the file name before the final
.
Source§impl FileSystemPath
impl FileSystemPath
pub fn read(self: Vc<Self>) -> Vc<FileContent>
pub fn read_link(self: Vc<Self>) -> Vc<LinkContent>
pub fn read_json(self: Vc<Self>) -> Vc<FileJsonContent>
pub fn read_json5(self: Vc<Self>) -> Vc<FileJsonContent>
Sourcepub fn raw_read_dir(self: Vc<Self>) -> Vc<RawDirectoryContent>
pub fn raw_read_dir(self: Vc<Self>) -> Vc<RawDirectoryContent>
Reads content of a directory.
DETERMINISM: Result is in random order. Either sort result or do not depend on the order.
pub fn write(self: Vc<Self>, content: Vc<FileContent>) -> Vc<()>
pub fn write_link(self: Vc<Self>, target: Vc<LinkContent>) -> Vc<()>
pub fn metadata(self: Vc<Self>) -> Vc<FileMeta>
pub fn realpath(self: Vc<Self>) -> Vc<FileSystemPath>
pub fn rebase( fs_path: Vc<FileSystemPath>, old_base: Vc<FileSystemPath>, new_base: Vc<FileSystemPath>, ) -> Vc<FileSystemPath>
Source§impl FileSystemPath
impl FileSystemPath
Sourcepub fn read_dir(self: Vc<Self>) -> Vc<DirectoryContent>
pub fn read_dir(self: Vc<Self>) -> Vc<DirectoryContent>
Reads content of a directory.
DETERMINISM: Result is in random order. Either sort result or do not depend on the order.
pub fn parent(self: Vc<Self>) -> Vc<FileSystemPath>
pub fn get_type(self: Vc<Self>) -> Vc<FileSystemEntryType>
pub fn realpath_with_links(self: Vc<Self>) -> Vc<RealPathResult>
Trait Implementations§
Source§impl Clone for FileSystemPath
impl Clone for FileSystemPath
Source§fn clone(&self) -> FileSystemPath
fn clone(&self) -> FileSystemPath
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FileSystemPath
impl Debug for FileSystemPath
Source§impl<'de> Deserialize<'de> for FileSystemPath
impl<'de> Deserialize<'de> for FileSystemPath
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for FileSystemPath
impl Display for FileSystemPath
Source§impl PartialEq for FileSystemPath
impl PartialEq for FileSystemPath
Source§impl Serialize for FileSystemPath
impl Serialize for FileSystemPath
Source§impl ShrinkToFit for FileSystemPath
impl ShrinkToFit for FileSystemPath
fn shrink_to_fit(&mut self)
Source§impl TraceRawVcs for FileSystemPath
impl TraceRawVcs for FileSystemPath
fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
Source§impl ValueDebug for FileSystemPath
impl ValueDebug for FileSystemPath
Source§impl ValueDebugFormat for FileSystemPath
impl ValueDebugFormat for FileSystemPath
fn value_debug_format<'a>(&'a self, depth: usize) -> ValueDebugFormatString<'a>
Source§impl VcValueType for FileSystemPath
impl VcValueType for FileSystemPath
Source§type Read = VcDefaultRead<FileSystemPath>
type Read = VcDefaultRead<FileSystemPath>
Source§type CellMode = VcCellSharedMode<FileSystemPath>
type CellMode = VcCellSharedMode<FileSystemPath>
Source§fn get_value_type_id() -> ValueTypeId
fn get_value_type_id() -> ValueTypeId
impl Eq for FileSystemPath
impl NonLocalValue for FileSystemPath
impl StructuralPartialEq for FileSystemPath
impl Upcast<Box<dyn ValueDebug>> for FileSystemPath
impl Upcast<Box<dyn ValueToString>> for FileSystemPath
Auto Trait Implementations§
impl Freeze for FileSystemPath
impl !RefUnwindSafe for FileSystemPath
impl Send for FileSystemPath
impl Sync for FileSystemPath
impl Unpin for FileSystemPath
impl !UnwindSafe for FileSystemPath
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more