pub struct UnityProject { /* private fields */ }
Implementations§
Source§impl UnityProject
impl UnityProject
Sourcepub async fn add_package_request<'env>(
&self,
env: &'env impl PackageCollection,
packages: &[PackageInfo<'env>],
operation: AddPackageOperation,
allow_prerelease: bool,
) -> Result<PendingProjectChanges<'env>, AddPackageErr>
pub async fn add_package_request<'env>( &self, env: &'env impl PackageCollection, packages: &[PackageInfo<'env>], operation: AddPackageOperation, allow_prerelease: bool, ) -> Result<PendingProjectChanges<'env>, AddPackageErr>
Creates a new AddPackageRequest
to add the specified packages.
You should call apply_pending_changes
to apply the changes after confirming to the user.
Source§impl UnityProject
impl UnityProject
pub async fn migrate_unity_2022( &mut self, collection: &impl PackageCollection, installer: &impl PackageInstaller, ) -> Result<(), MigrateUnity2022Error>
Source§impl UnityProject
impl UnityProject
pub async fn migrate_vpm( &mut self, collection: &impl PackageCollection, installer: &impl PackageInstaller, include_prerelease: bool, ) -> Result<(), MigrateVpmError>
Source§impl UnityProject
impl UnityProject
Sourcepub async fn apply_pending_changes<'env, Env: PackageInstaller>(
&mut self,
env: &'env Env,
request: PendingProjectChanges<'env>,
) -> Result<()>
pub async fn apply_pending_changes<'env, Env: PackageInstaller>( &mut self, env: &'env Env, request: PendingProjectChanges<'env>, ) -> Result<()>
Applies the changes specified in AddPackageRequest
to the project.
This will also save the manifest changes
Source§impl UnityProject
impl UnityProject
pub async fn detect_project_type(&self) -> ProjectType
Source§impl UnityProject
impl UnityProject
pub async fn reinstall_request<'env>( &self, env: &'env impl PackageCollection, packages: &[&str], ) -> Result<PendingProjectChanges<'env>, ReinstalPackagesError>
Source§impl UnityProject
impl UnityProject
Sourcepub async fn remove_request(
&self,
remove: &[&str],
) -> Result<PendingProjectChanges<'static>, RemovePackageErr>
pub async fn remove_request( &self, remove: &[&str], ) -> Result<PendingProjectChanges<'static>, RemovePackageErr>
Remove specified package from self project.
This doesn’t look packages not listed in vpm-maniefst.json.
Source§impl UnityProject
impl UnityProject
Sourcepub fn should_resolve(&self) -> bool
pub fn should_resolve(&self) -> bool
Returns whether the project should be resolved.
The project will be resolved if: (not exhaustive)
- some packages defined in
locked
section are missing - some packages defined in
dependencies
section are missing - some dependencies of unlocked packages are missing
pub async fn resolve_request<'env>( &self, env: &'env impl PackageCollection, ) -> Result<PendingProjectChanges<'env>, ResolvePackageErr>
Source§impl UnityProject
impl UnityProject
pub async fn load(io: DefaultProjectIo) -> Result<Self>
Source§impl UnityProject
impl UnityProject
Source§impl UnityProject
impl UnityProject
pub fn locked_packages(&self) -> impl Iterator<Item = LockedDependencyInfo<'_>>
pub fn dependencies(&self) -> impl Iterator<Item = &str>
pub fn get_locked(&self, name: &str) -> Option<LockedDependencyInfo<'_>>
pub fn is_locked(&self, name: &str) -> bool
pub fn all_packages(&self) -> impl Iterator<Item = LockedDependencyInfo<'_>>
pub fn unlocked_packages(&self) -> &[(Box<str>, Option<PackageManifest>)]
pub fn installed_packages( &self, ) -> impl Iterator<Item = (&str, &PackageManifest)>
pub fn get_installed_package(&self, name: &str) -> Option<&PackageManifest>
pub fn all_installed_packages(&self) -> impl Iterator<Item = &PackageManifest>
pub fn unity_version(&self) -> UnityVersion
pub fn unity_revision(&self) -> Option<&str>
pub fn has_upm_package(&self, name: &str) -> bool
Sourcepub fn add_dependency_raw(&mut self, name: &str, version: DependencyRange)
pub fn add_dependency_raw(&mut self, name: &str, version: DependencyRange)
Adds dependency without actually adding package. This only modifies manifest
Source§impl UnityProject
impl UnityProject
pub fn project_dir(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UnityProject
impl RefUnwindSafe for UnityProject
impl Send for UnityProject
impl Sync for UnityProject
impl Unpin for UnityProject
impl UnwindSafe for UnityProject
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> 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