pub enum ServiceRef {
Default(String),
Custom {
registry: String,
service: String,
},
Path {
dir: PathBuf,
name: String,
},
}Expand description
A reference to a service in a registry.
Default("forgejo")— refers to a service in the project-managed default registry (cloned fromDEFAULT_REGISTRY_URL).Custom { registry: "acme", service: "forgejo" }— refers to a service in a user-added custom registry.
Variants§
Default(String)
A service from the default registry. E.g., forgejo.
Custom
A service from a named custom registry. E.g., acme/forgejo.
Path
A local project directory whose service.toml lives at its root
(ryra add . / ryra add ./path). dir is absolute; name is the
[service].name read from the file.
Implementations§
Source§impl ServiceRef
impl ServiceRef
Sourcepub fn parse(input: &str) -> Result<Self>
pub fn parse(input: &str) -> Result<Self>
Parse a service reference from a string.
"forgejo"→Default("forgejo")"acme/forgejo"→Custom { registry: "acme", service: "forgejo" }"","/forgejo","acme/","acme/sub/forgejo"→ error
Sourcepub fn service_name(&self) -> &str
pub fn service_name(&self) -> &str
Returns the service name part of this reference.
Sourcepub fn registry_name(&self) -> &str
pub fn registry_name(&self) -> &str
Returns the registry name for this reference.
Returns "default" for default-registry services. For a local path
install it returns the project directory, which is what gets recorded in
metadata so ryra upgrade can re-read the same service.toml.
Trait Implementations§
Source§impl Clone for ServiceRef
impl Clone for ServiceRef
Source§fn clone(&self) -> ServiceRef
fn clone(&self) -> ServiceRef
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 moreSource§impl Debug for ServiceRef
impl Debug for ServiceRef
impl Eq for ServiceRef
Source§impl PartialEq for ServiceRef
impl PartialEq for ServiceRef
Source§fn eq(&self, other: &ServiceRef) -> bool
fn eq(&self, other: &ServiceRef) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ServiceRef
Auto Trait Implementations§
impl Freeze for ServiceRef
impl RefUnwindSafe for ServiceRef
impl Send for ServiceRef
impl Sync for ServiceRef
impl Unpin for ServiceRef
impl UnsafeUnpin for ServiceRef
impl UnwindSafe for ServiceRef
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.