pub struct SubmoduleContext<'a> {
pub name: Cow<'a, str>,
pub path: Cow<'a, str>,
pub url: Cow<'a, str>,
pub branch: Cow<'a, str>,
pub context: GitContext,
}
Expand description
A git context for a submodule for use within checks.
Checks which need to inspect submodules should use this to obtain a GitContext
for the
submodule.
Fields§
§name: Cow<'a, str>
The name of the submodule (usually the same as path
).
path: Cow<'a, str>
The path of the submodule within the repository.
url: Cow<'a, str>
The clone URL for the submodule.
branch: Cow<'a, str>
The branch the submodule tracks.
context: GitContext
The context to use to query the submodule.
Implementations§
Source§impl<'a> SubmoduleContext<'a>
impl<'a> SubmoduleContext<'a>
Sourcepub fn new(ctx: &'a CheckGitContext, diff_path: &str) -> Option<Self>
pub fn new(ctx: &'a CheckGitContext, diff_path: &str) -> Option<Self>
Create submodule context for the given path.
Returns None
if the requisite information is not available within the context being used.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SubmoduleContext<'a>
impl<'a> RefUnwindSafe for SubmoduleContext<'a>
impl<'a> Send for SubmoduleContext<'a>
impl<'a> Sync for SubmoduleContext<'a>
impl<'a> Unpin for SubmoduleContext<'a>
impl<'a> UnwindSafe for SubmoduleContext<'a>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more