pub struct Dependency {
pub publisher: String,
pub id: String,
pub version: Option<String>,
pub version_operator: Option<VersionOperator>,
}Expand description
Represents a parsed dependency URI
Fields§
§publisher: String§id: String§version: Option<String>§version_operator: Option<VersionOperator>Implementations§
Source§impl Dependency
impl Dependency
Sourcepub fn parse(uri: &str) -> ProtocolResult<Self>
pub fn parse(uri: &str) -> ProtocolResult<Self>
Parse a dependency URI like “canon-protocol.org/type@1.0.0” or with version operators like “canon-protocol.org/type@^1.0.0”
Sourcepub fn local_path_with_registry(&self, registry: &str) -> PathBuf
pub fn local_path_with_registry(&self, registry: &str) -> PathBuf
Get the local storage path for this dependency with registry
Sourcepub fn local_path(&self) -> PathBuf
pub fn local_path(&self) -> PathBuf
Get the local storage path for this dependency (defaults to canon.canon-protocol.org)
Sourcepub fn is_in_localhost(&self) -> bool
pub fn is_in_localhost(&self) -> bool
Check if this dependency exists in localhost
Sourcepub fn is_installed(&self) -> bool
pub fn is_installed(&self) -> bool
Check if this dependency is already installed
Trait Implementations§
Source§impl Clone for Dependency
impl Clone for Dependency
Source§fn clone(&self) -> Dependency
fn clone(&self) -> Dependency
Returns a duplicate of the value. Read more
1.0.0 · 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 Dependency
impl RefUnwindSafe for Dependency
impl Send for Dependency
impl Sync for Dependency
impl Unpin for Dependency
impl UnwindSafe for Dependency
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