pub enum LinkTarget {
Absolute {
resolved: FileSystemPath,
},
Relative {
raw: RcStr,
resolved: FileSystemPath,
},
}Expand description
The target of a symbolic link, as read from a filesystem.
Every variant carries the resolved path the link points at, computed once by
crate::FileSystem::read_link, which is also what guarantees the target stays inside the
filesystem root — a link whose target leaves the root is LinkContent::Invalid instead.
Variants§
Absolute
The link is an absolute path on disk.
Fields
resolved: FileSystemPathRelative
Fields
raw: RcStrThe value read from the link. The path is lexically converted to a [unix-style
path][turbo_unix_path::sys_to_unix], but it may contain .. relative to the directory
containing the link.
resolved: FileSystemPathThe link target relative the a DiskFileSystem root.
Implementations§
Source§impl LinkTarget
impl LinkTarget
Sourcepub fn file_system_path(&self) -> &FileSystemPath
pub fn file_system_path(&self) -> &FileSystemPath
The path this link points at.
Sourcepub async fn target_type(&self) -> Result<FileSystemEntryType>
pub async fn target_type(&self) -> Result<FileSystemEntryType>
The type of the file this link points at.
This only follows a single link: if the target is itself a symbolic link, this returns
FileSystemEntryType::Symlink. Use FileSystemPath::realpath to follow a chain of
links.
A dangling link returns FileSystemEntryType::NotFound.
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for LinkTarget
impl<'__de, __Context> BorrowDecode<'__de, __Context> for LinkTarget
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Source§impl Clone for LinkTarget
impl Clone for LinkTarget
Source§fn clone(&self) -> LinkTarget
fn clone(&self) -> LinkTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LinkTarget
impl Debug for LinkTarget
Source§impl<__Context> Decode<__Context> for LinkTarget
impl<__Context> Decode<__Context> for LinkTarget
Source§impl Encode for LinkTarget
impl Encode for LinkTarget
impl Eq for LinkTarget
Source§impl Hash for LinkTarget
impl Hash for LinkTarget
impl NonLocalValue for LinkTarget
Source§impl PartialEq for LinkTarget
impl PartialEq for LinkTarget
impl StructuralPartialEq for LinkTarget
Source§impl TraceRawVcs for LinkTarget
impl TraceRawVcs for LinkTarget
fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
Auto Trait Implementations§
impl !RefUnwindSafe for LinkTarget
impl !UnwindSafe for LinkTarget
impl Freeze for LinkTarget
impl Send for LinkTarget
impl Sync for LinkTarget
impl Unpin for LinkTarget
impl UnsafeUnpin for LinkTarget
Blanket Implementations§
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<T> DynEq for T
§impl<T> DynPartialEq for T
impl<T> DynPartialEq for T
fn dyn_partial_eq(&self, other: &(dyn Any + 'static)) -> bool
§impl<T> DynTaskInputs for T
impl<T> DynTaskInputs for T
fn dyn_type_name(&self) -> &'static str
§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<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> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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