Struct UnityProject

Source
pub struct UnityProject { /* private fields */ }

Implementations§

Source§

impl UnityProject

Source

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

Source

pub async fn migrate_unity_2022( &mut self, collection: &impl PackageCollection, installer: &impl PackageInstaller, ) -> Result<(), MigrateUnity2022Error>

Source§

impl UnityProject

Source

pub async fn migrate_vpm( &mut self, collection: &impl PackageCollection, installer: &impl PackageInstaller, include_prerelease: bool, ) -> Result<(), MigrateVpmError>

Source§

impl UnityProject

Source

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

Source

pub async fn detect_project_type(&self) -> ProjectType

Source§

impl UnityProject

Source

pub async fn reinstall_request<'env>( &self, env: &'env impl PackageCollection, packages: &[&str], ) -> Result<PendingProjectChanges<'env>, ReinstalPackagesError>

Source§

impl UnityProject

Source

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

Source

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
Source

pub async fn resolve_request<'env>( &self, env: &'env impl PackageCollection, ) -> Result<PendingProjectChanges<'env>, ResolvePackageErr>

Source§

impl UnityProject

Source

pub async fn load(io: DefaultProjectIo) -> Result<Self>

Source§

impl UnityProject

Source

pub fn io(&self) -> &DefaultProjectIo

Source

pub async fn save(&mut self) -> Result<()>

Source§

impl UnityProject

Source

pub fn locked_packages(&self) -> impl Iterator<Item = LockedDependencyInfo<'_>>

Source

pub fn dependencies(&self) -> impl Iterator<Item = &str>

Source

pub fn get_locked(&self, name: &str) -> Option<LockedDependencyInfo<'_>>

Source

pub fn is_locked(&self, name: &str) -> bool

Source

pub fn all_packages(&self) -> impl Iterator<Item = LockedDependencyInfo<'_>>

Source

pub fn unlocked_packages(&self) -> &[(Box<str>, Option<PackageManifest>)]

Source

pub fn installed_packages( &self, ) -> impl Iterator<Item = (&str, &PackageManifest)>

Source

pub fn get_installed_package(&self, name: &str) -> Option<&PackageManifest>

Source

pub fn all_installed_packages(&self) -> impl Iterator<Item = &PackageManifest>

Source

pub fn unity_version(&self) -> UnityVersion

Source

pub fn unity_revision(&self) -> Option<&str>

Source

pub fn has_upm_package(&self, name: &str) -> bool

Source

pub fn add_dependency_raw(&mut self, name: &str, version: DependencyRange)

Adds dependency without actually adding package. This only modifies manifest

Source§

impl UnityProject

Source

pub fn project_dir(&self) -> &Path

Trait Implementations§

Source§

impl Debug for UnityProject

Source§

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

Formats the value using the given formatter. Read more

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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