pub struct SymlinkFarm<S = Materialized> {
pub staging_dir: PathBuf,
pub links: HashMap<String, PathBuf>,
/* private fields */
}Expand description
A symlink farm mapping relative file paths to their source locations.
Uses a typestate pattern (Built → Materialized) to enforce at
compile time that materialize() must be called before deploy_to().
The PhantomData<S> marker is zero-sized and erased at runtime.
Fields§
§staging_dir: PathBufThe staging directory for this profile.
links: HashMap<String, PathBuf>Map of relative path -> absolute source path (winner after priority resolution).
Implementations§
Source§impl SymlinkFarm<Built>
impl SymlinkFarm<Built>
Sourcepub fn from_links(staging_dir: PathBuf, links: HashMap<String, PathBuf>) -> Self
pub fn from_links(staging_dir: PathBuf, links: HashMap<String, PathBuf>) -> Self
Construct a Built farm directly from a staging directory and link map.
Sourcepub fn build(
profile_name: &str,
resolved: &ResolvedLoadOrder,
mod_files: &HashMap<ModId, Vec<(String, PathBuf)>>,
overrides: Option<&[(String, PathBuf)]>,
hidden: Option<&HashSet<(String, String)>>,
) -> Result<Self>
pub fn build( profile_name: &str, resolved: &ResolvedLoadOrder, mod_files: &HashMap<ModId, Vec<(String, PathBuf)>>, overrides: Option<&[(String, PathBuf)]>, hidden: Option<&HashSet<(String, String)>>, ) -> Result<Self>
Build a symlink farm from a resolved load order and the content-addressed store.
mod_files maps each mod ID to its list of (relative_path, store_entry_path) pairs.
overrides (if provided) are layered on top — override files win over all mods.
hidden is a set of (mod_id, rel_path) pairs to exclude from the farm.
Sourcepub async fn materialize(self) -> Result<SymlinkFarm<Materialized>>
pub async fn materialize(self) -> Result<SymlinkFarm<Materialized>>
Materialize the symlink farm on disk, transitioning to Materialized state.
Trait Implementations§
Source§impl<S: Clone> Clone for SymlinkFarm<S>
impl<S: Clone> Clone for SymlinkFarm<S>
Source§fn clone(&self) -> SymlinkFarm<S>
fn clone(&self) -> SymlinkFarm<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<S> Freeze for SymlinkFarm<S>
impl<S> RefUnwindSafe for SymlinkFarm<S>where
S: RefUnwindSafe,
impl<S> Send for SymlinkFarm<S>where
S: Send,
impl<S> Sync for SymlinkFarm<S>where
S: Sync,
impl<S> Unpin for SymlinkFarm<S>where
S: Unpin,
impl<S> UnsafeUnpin for SymlinkFarm<S>
impl<S> UnwindSafe for SymlinkFarm<S>where
S: UnwindSafe,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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