pub struct RootPackage {
pub name: String,
pub pretty_version: String,
pub version: String,
pub reference: Option<String>,
pub package_type: String,
pub dev: bool,
pub aliases: Vec<String>,
pub alias_normalized: Option<String>,
}Expand description
The project’s root package (composer.json), for installed.php.
Fields§
§name: String§pretty_version: String§version: String§reference: Option<String>§package_type: String§dev: bool§aliases: Vec<String>Branch alias (extra.branch-alias): pretty version of the alias.
alias_normalized: Option<String>The same alias, normalised (RootAliasPackage::getVersion()).
Implementations§
Source§impl RootPackage
impl RootPackage
Sourcepub fn detect(manifest: &Value, project_dir: &Path, dev: bool) -> RootPackage
pub fn detect(manifest: &Value, project_dir: &Path, dev: bool) -> RootPackage
Like RootPackageLoader: version from composer.json, else
COMPOSER_ROOT_VERSION, else guessed from git, else
1.0.0+no-version-set (see root_version.rs).
Sourcepub fn from_manifest(manifest: &Value, dev: bool) -> RootPackage
pub fn from_manifest(manifest: &Value, dev: bool) -> RootPackage
Without VCS or environment detection (tests, cases with no project on disk).
Trait Implementations§
Source§impl Clone for RootPackage
impl Clone for RootPackage
Source§fn clone(&self) -> RootPackage
fn clone(&self) -> RootPackage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RootPackage
impl RefUnwindSafe for RootPackage
impl Send for RootPackage
impl Sync for RootPackage
impl Unpin for RootPackage
impl UnsafeUnpin for RootPackage
impl UnwindSafe for RootPackage
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