pub enum Source {
Member(Source),
Git(Source),
Path(Source),
Registry(Source),
}Expand description
Specifies a base source for a package.
- For registry packages, this includes a base version.
- For git packages, this includes a base git reference like a branch or tag.
Note that a Source does not specify a specific, pinned version. Rather, it specifies a source
at which the current latest version may be located.
Variants§
Member(Source)
Used to refer to a workspace member project.
Git(Source)
A git repo with a Forc.toml manifest at its root.
Path(Source)
A path to a directory with a Forc.toml manifest at its root.
Registry(Source)
A forc project hosted on the official registry.
Implementations§
source§impl Source
impl Source
sourcepub fn from_manifest_dep(
manifest_dir: &Path,
dep: &Dependency,
member_manifests: &MemberManifestFiles
) -> Result<Self>
pub fn from_manifest_dep( manifest_dir: &Path, dep: &Dependency, member_manifests: &MemberManifestFiles ) -> Result<Self>
Convert the given manifest Dependency declaration to a Source.
sourcepub fn from_manifest_dep_patched(
manifest: &PackageManifestFile,
dep_name: &str,
dep: &Dependency,
members: &MemberManifestFiles
) -> Result<Self>
pub fn from_manifest_dep_patched( manifest: &PackageManifestFile, dep_name: &str, dep: &Dependency, members: &MemberManifestFiles ) -> Result<Self>
Convert the given manifest Dependency declaration to a source,
applying any relevant patches from within the given manifest as
necessary.
sourcepub fn apply_patch(
&self,
dep_name: &str,
manifest: &PackageManifestFile,
members: &MemberManifestFiles
) -> Result<Self>
pub fn apply_patch( &self, dep_name: &str, manifest: &PackageManifestFile, members: &MemberManifestFiles ) -> Result<Self>
If a patch exists for the dependency associated with this source within
the given manifest, this returns a new Source with the patch applied.
If no patch exists, this returns the original Source.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Ord for Source
impl Ord for Source
source§impl PartialEq<Source> for Source
impl PartialEq<Source> for Source
source§impl PartialOrd<Source> for Source
impl PartialOrd<Source> for Source
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Eq for Source
impl StructuralEq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
Blanket Implementations§
§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any.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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.