Skip to main content

LinkContent

Enum LinkContent 

Source
pub enum LinkContent {
    Link {
        target: LinkTarget,
    },
    NotFound,
    Invalid {
        reason: RcStr,
    },
}
Expand description

The contents of a symbolic link, as read from a filesystem. On Windows, this may be a junction point.

We treat symbolic links and junction points on Windows as equivalent when reading.

This describes the link itself and never the type of the file it points at. Use LinkTarget::target_type if you need the type of the target.

Variants§

A valid symbolic link pointing to target.

Fields

§target: LinkTarget
§

NotFound

The link itself does not exist at the path given to FileSystemPath::read_link.

This says nothing about whether the link’s target exists: a dangling link is still returned as LinkContent::Link.

§

Invalid

The link could not be read.

This includes all I/O errors other than NotFound, denied paths, and targets that leave the filesystem root. A relative target that steps out of the root and back into it is also invalid, since resolving it would need the names of the root’s own ancestors, which a root-relative path doesn’t carry.

Fields

§reason: RcStr

Implementations§

Source§

impl LinkContent

Source

pub fn cell(self) -> Vc<Self>

Places a value in a cell of the current task.

Cell is selected based on the value type and call order of cell.

Source

pub fn resolved_cell(self) -> ResolvedVc<Self>

Places a value in a cell of the current task. Returns a [ResolvedVc][turbo_tasks::ResolvedVc].

Cell is selected based on the value type and call order of cell.

Source§

impl LinkContent

Source

pub fn hash( self: Vc<Self>, salt: Vc<RcStr>, algorithm: HashAlgorithm, ) -> Vc<RcStr>

Hashes the link itself (its target and type), not the content of whatever the link points at. This mirrors FileContent::hash and is the right content hash for consumers that re-create a symlink as a symlink instead of copying the resolved file.

Trait Implementations§

Source§

impl<'__de, __Context> BorrowDecode<'__de, __Context> for LinkContent

Source§

fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
Source§

impl Debug for LinkContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<__Context> Decode<__Context> for LinkContent

Source§

fn decode<__D: Decoder<Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl Encode for LinkContent

Source§

fn encode<__E: Encoder>(&self, encoder: &mut __E) -> Result<(), EncodeError>

Encode a given type.
Source§

impl Eq for LinkContent

Source§

impl NonLocalValue for LinkContent

Source§

impl PartialEq for LinkContent

Source§

fn eq(&self, other: &LinkContent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl ShrinkToFit for LinkContent

Source§

fn shrink_to_fit(&mut self)

Source§

impl StructuralPartialEq for LinkContent

Source§

impl TraceRawVcs for LinkContent

Source§

fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)

§

fn get_raw_vcs(&self) -> Vec<RawVc>

Source§

impl Upcast<Box<dyn ValueDebug>> for LinkContent

Source§

impl UpcastStrict<Box<dyn ValueDebug>> for LinkContent

Source§

impl ValueDebug for LinkContent

Source§

fn dbg_depth<'a>( &'a self, depth: usize, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>

Like dbg, but with a depth limit.
§

fn dbg( &self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + '_>>

Source§

impl ValueDebugFormat for LinkContent

Available on debug-assertions enabled only.
Source§

fn value_debug_format<'a>(&'a self, depth: usize) -> ValueDebugFormatString<'a>

Source§

impl VcValueType for LinkContent

Source§

type Read = VcDefaultRead<LinkContent>

How to read the value.
Source§

type CellMode = VcCellCompareMode<LinkContent>

How to update cells of this value type.
Source§

fn get_value_type_id() -> ValueTypeId

Returns the type id of the value type.
Source§

fn has_serialization() -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> DynEq for T
where T: Any + Eq,

§

impl<T> DynPartialEq for T
where T: Any + PartialEq,

§

fn dyn_partial_eq(&self, other: &(dyn Any + 'static)) -> bool

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> MaybeSendSync for T

§

impl<T> MaybeTypeTag for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more