pub struct ForgeRemote {
pub forge_kind: ForgeKind,
pub host: String,
pub namespace: String,
pub project: String,
pub repo_url: String,
pub web_url: String,
}Expand description
Normalized repository remote metadata for one supported forge.
Fields§
§forge_kind: ForgeKindForge family inferred from the repository remote.
host: StringForge hostname used for browser and API calls.
HTTPS remotes keep any explicit web/API port, while SSH transport ports are stripped during remote normalization.
namespace: StringRepository namespace or owner path.
project: StringRepository name without a trailing .git suffix.
repo_url: StringOriginal remote URL returned by git.
web_url: StringBrowser-openable repository URL derived from the remote.
Implementations§
Source§impl ForgeRemote
impl ForgeRemote
Sourcepub fn project_path(&self) -> String
pub fn project_path(&self) -> String
Returns the <namespace>/<project> path used by forge CLIs and URLs.
Sourcepub fn review_request_creation_url(
&self,
source_branch: &str,
target_branch: &str,
) -> Result<String, ReviewRequestError>
pub fn review_request_creation_url( &self, source_branch: &str, target_branch: &str, ) -> Result<String, ReviewRequestError>
Returns the browser-openable URL that starts one new pull request or
merge request for source_branch into target_branch.
§Errors
Returns ReviewRequestError::OperationFailed when the stored
repository web URL is invalid or cannot be converted into a forge
review-request creation URL.
Trait Implementations§
Source§impl Clone for ForgeRemote
impl Clone for ForgeRemote
Source§fn clone(&self) -> ForgeRemote
fn clone(&self) -> ForgeRemote
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more