pub struct Project { /* private fields */ }Expand description
The main struct of the pesde library, representing a project
Implementations§
Source§impl Project
impl Project
Sourcepub async fn download_graph(
&self,
graph: &DependencyGraph,
refreshed_sources: &mut HashSet<PackageSources>,
reqwest: &Client,
prod: bool,
write: bool,
wally: bool,
) -> Result<(Receiver<Result<String, DownloadGraphError>>, Arc<Mutex<DownloadedGraph>>), DownloadGraphError>
pub async fn download_graph( &self, graph: &DependencyGraph, refreshed_sources: &mut HashSet<PackageSources>, reqwest: &Client, prod: bool, write: bool, wally: bool, ) -> Result<(Receiver<Result<String, DownloadGraphError>>, Arc<Mutex<DownloadedGraph>>), DownloadGraphError>
Downloads a graph of dependencies
Source§impl Project
impl Project
Sourcepub async fn download_and_link<F: FnOnce(&Arc<DownloadedGraph>) -> R + Send + 'static, R: Future<Output = Result<(), E>> + Send, E: Send + Sync + 'static>(
&self,
graph: &Arc<DependencyGraph>,
refreshed_sources: &Arc<Mutex<HashSet<PackageSources>>>,
reqwest: &Client,
prod: bool,
write: bool,
pesde_cb: F,
) -> Result<(DownloadAndLinkReceiver, impl Future<Output = Result<DownloadedGraph, DownloadAndLinkError<E>>>), DownloadAndLinkError<E>>
pub async fn download_and_link<F: FnOnce(&Arc<DownloadedGraph>) -> R + Send + 'static, R: Future<Output = Result<(), E>> + Send, E: Send + Sync + 'static>( &self, graph: &Arc<DependencyGraph>, refreshed_sources: &Arc<Mutex<HashSet<PackageSources>>>, reqwest: &Client, prod: bool, write: bool, pesde_cb: F, ) -> Result<(DownloadAndLinkReceiver, impl Future<Output = Result<DownloadedGraph, DownloadAndLinkError<E>>>), DownloadAndLinkError<E>>
Downloads a graph of dependencies and links them in the correct order
Source§impl Project
impl Project
Sourcepub async fn link_dependencies(
&self,
graph: &DownloadedGraph,
with_types: bool,
) -> Result<(), LinkingError>
pub async fn link_dependencies( &self, graph: &DownloadedGraph, with_types: bool, ) -> Result<(), LinkingError>
Links the dependencies of the project
Source§impl Project
impl Project
Sourcepub async fn dependency_graph(
&self,
previous_graph: Option<&DependencyGraph>,
refreshed_sources: &mut HashSet<PackageSources>,
is_published_package: bool,
) -> Result<DependencyGraph, Box<DependencyGraphError>>
pub async fn dependency_graph( &self, previous_graph: Option<&DependencyGraph>, refreshed_sources: &mut HashSet<PackageSources>, is_published_package: bool, ) -> Result<DependencyGraph, Box<DependencyGraphError>>
Create a dependency graph from the project’s manifest
Source§impl Project
impl Project
Sourcepub fn new<P: AsRef<Path>, Q: AsRef<Path>, R: AsRef<Path>, S: AsRef<Path>>(
package_dir: P,
workspace_dir: Option<Q>,
data_dir: R,
cas_dir: S,
auth_config: AuthConfig,
) -> Self
pub fn new<P: AsRef<Path>, Q: AsRef<Path>, R: AsRef<Path>, S: AsRef<Path>>( package_dir: P, workspace_dir: Option<Q>, data_dir: R, cas_dir: S, auth_config: AuthConfig, ) -> Self
Create a new Project
Sourcepub fn package_dir(&self) -> &Path
pub fn package_dir(&self) -> &Path
The directory of the package
Sourcepub fn workspace_dir(&self) -> Option<&Path>
pub fn workspace_dir(&self) -> Option<&Path>
The directory of the workspace this package belongs to, if any
Sourcepub fn auth_config(&self) -> &AuthConfig
pub fn auth_config(&self) -> &AuthConfig
The authentication configuration
Sourcepub async fn read_manifest(&self) -> Result<String, ManifestReadError>
pub async fn read_manifest(&self) -> Result<String, ManifestReadError>
Read the manifest file
Sourcepub async fn deser_manifest(&self) -> Result<Manifest, ManifestReadError>
pub async fn deser_manifest(&self) -> Result<Manifest, ManifestReadError>
Deserialize the manifest file
Sourcepub async fn write_manifest<S: AsRef<[u8]>>(
&self,
manifest: S,
) -> Result<(), Error>
pub async fn write_manifest<S: AsRef<[u8]>>( &self, manifest: S, ) -> Result<(), Error>
Write the manifest file
Sourcepub async fn deser_lockfile(&self) -> Result<Lockfile, LockfileReadError>
pub async fn deser_lockfile(&self) -> Result<Lockfile, LockfileReadError>
Deserialize the lockfile
Sourcepub async fn write_lockfile(
&self,
lockfile: Lockfile,
) -> Result<(), LockfileWriteError>
pub async fn write_lockfile( &self, lockfile: Lockfile, ) -> Result<(), LockfileWriteError>
Write the lockfile
Sourcepub async fn workspace_members<P: AsRef<Path> + Debug>(
&self,
dir: P,
can_ref_self: bool,
) -> Result<impl Stream<Item = Result<(PathBuf, Manifest), WorkspaceMembersError>>, WorkspaceMembersError>
pub async fn workspace_members<P: AsRef<Path> + Debug>( &self, dir: P, can_ref_self: bool, ) -> Result<impl Stream<Item = Result<(PathBuf, Manifest), WorkspaceMembersError>>, WorkspaceMembersError>
Get the workspace members
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
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
Mutably borrows from an owned value. Read more
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>
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 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>
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