pub struct Crate(_);
Expand description
A Rust crate that can be used with rustwide.
Implementations§
source§impl Crate
impl Crate
sourcepub fn registry(
registry: AlternativeRegistry,
name: &str,
version: &str
) -> Self
pub fn registry( registry: AlternativeRegistry, name: &str, version: &str ) -> Self
Load a crate from specified registry.
sourcepub fn crates_io(name: &str, version: &str) -> Self
pub fn crates_io(name: &str, version: &str) -> Self
Load a crate from the crates.io registry.
sourcepub fn git(url: &str) -> Self
pub fn git(url: &str) -> Self
Load a crate from a git repository. The full URL needed to clone the repo has to be provided.
sourcepub fn fetch(&self, workspace: &Workspace) -> Result<(), Error>
pub fn fetch(&self, workspace: &Workspace) -> Result<(), Error>
Fetch the crate’s source code and cache it in the workspace. This method will reach out to the network for some crate types.
sourcepub fn purge_from_cache(&self, workspace: &Workspace) -> Result<(), Error>
pub fn purge_from_cache(&self, workspace: &Workspace) -> Result<(), Error>
Remove the cached copy of this crate. The method will do nothing if the crate isn’t cached.
sourcepub fn git_commit(&self, workspace: &Workspace) -> Option<String>
pub fn git_commit(&self, workspace: &Workspace) -> Option<String>
Get this crate’s git commit. This method is best-effort, and currently works just for git
crates. If the commit can’t be retrieved None
will be returned.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Crate
impl Send for Crate
impl Sync for Crate
impl Unpin for Crate
impl UnwindSafe for Crate
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