Struct git_repository::Url
source · [−]pub struct Url {
pub scheme: Scheme,
pub port: Option<u16>,
pub path: BString,
/* private fields */
}
Expand description
A URL with support for specialized git related capabilities.
Additionally there is support for deserialization and serialization
(see the Display::fmt()
implementation).
Note that we do not support passing the password using the URL as it’s likely leading to accidents.
Fields
scheme: Scheme
The URL scheme.
port: Option<u16>
The port to use when connecting to a host. If None
, standard ports depending on scheme
will be used.
path: BString
The path portion of the URL, usually the location of the git repository.
Implementations
sourceimpl Url
impl Url
Access
sourcepub fn path_is_root(&self) -> bool
pub fn path_is_root(&self) -> bool
Returns true if the path portion of the url is /
.
sourcepub fn port_or_default(&self) -> Option<u16>
pub fn port_or_default(&self) -> Option<u16>
Returns the actual or default port for use according to the url scheme. Note that there may be no default port either.
Trait Implementations
sourceimpl Ord for Url
impl Ord for Url
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Url> for Url
impl PartialOrd<Url> for Url
sourcefn partial_cmp(&self, other: &Url) -> Option<Ordering>
fn partial_cmp(&self, other: &Url) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Url
impl StructuralEq for Url
impl StructuralPartialEq for Url
Auto Trait Implementations
impl RefUnwindSafe for Url
impl Send for Url
impl Sync for Url
impl Unpin for Url
impl UnwindSafe for Url
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more