pub struct Validate;
Expand description
Common validation utilities
Implementations§
Source§impl Validate
impl Validate
Sourcepub fn commit_exists(commit: &str) -> Result<()>
pub fn commit_exists(commit: &str) -> Result<()>
Validate that a commit exists
Sourcepub fn in_git_repo() -> Result<()>
pub fn in_git_repo() -> Result<()>
Validate that we’re in a git repository
Sourcepub fn branch_name(name: &str) -> Result<()>
pub fn branch_name(name: &str) -> Result<()>
Validate branch name format
Sourcepub fn commit_hash(hash: &str) -> Result<()>
pub fn commit_hash(hash: &str) -> Result<()>
Validate commit hash format (40 chars hex or 7+ chars for short hash)
Sourcepub fn remote_name(name: &str) -> Result<()>
pub fn remote_name(name: &str) -> Result<()>
Validate remote name format
Sourcepub fn positive_number(
value: i32,
max: Option<i32>,
field_name: &str,
) -> Result<()>
pub fn positive_number( value: i32, max: Option<i32>, field_name: &str, ) -> Result<()>
Validate that a number is within a reasonable range
Sourcepub fn git_date_format(date_str: &str) -> Result<()>
pub fn git_date_format(date_str: &str) -> Result<()>
Validate date/time string format for git operations
Auto Trait Implementations§
impl Freeze for Validate
impl RefUnwindSafe for Validate
impl Send for Validate
impl Sync for Validate
impl Unpin for Validate
impl UnwindSafe for Validate
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