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(&self) -> PathBuf
pub fn local_path(&self) -> PathBuf
Get the local path for this dependency
Sourcepub fn remote_cache_path(&self) -> PathBuf
pub fn remote_cache_path(&self) -> PathBuf
Get the remote cache path for this dependency
Sourcepub fn exists_locally(&self) -> bool
pub fn exists_locally(&self) -> bool
Check if this dependency exists locally
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