pub struct Remote {
pub api: String,
pub repo: String,
}Expand description
The API base and repository recovered from a git remote URL.
Fields§
§api: StringDaemon base URL, with any credentials removed.
repo: Stringowner/repo, without the .git suffix.
Implementations§
Source§impl Remote
impl Remote
Sourcepub fn parse(url: &str) -> Result<Self, Failure>
pub fn parse(url: &str) -> Result<Self, Failure>
Recovers the API base and repository from a clone URL.
Credentials in the authority are dropped rather than carried:
this value is printed in progress output and passed to curl on
an argv, and a password on an argv is readable by every process
on the host through ps. The token the request actually needs
comes from --auth-file.
§Errors
Returns a Failure when the URL carries no scheme, names no
owner/repo path, or uses a scheme with no HTTP API base to
derive — ssh:// being the one that reaches a choir node but
says nothing about where its API listens.
Trait Implementations§
impl Eq for Remote
impl StructuralPartialEq for Remote
Auto Trait Implementations§
impl Freeze for Remote
impl RefUnwindSafe for Remote
impl Send for Remote
impl Sync for Remote
impl Unpin for Remote
impl UnsafeUnpin for Remote
impl UnwindSafe for Remote
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