#[non_exhaustive]pub enum PathReject {
Show 17 variants
Empty,
TooLong,
ComponentTooLong,
Nul,
Control,
NonAscii,
ForbiddenCharacter,
Absolute,
HomeReference,
DotDot,
DotComponent,
TrailingDot,
LockSuffix,
LeadingDash,
EmptyComponent,
TooFewComponents,
TooManyComponents,
}Expand description
Why a repository path was refused.
Carried in Error::InvalidPath so tests can assert which rule fired
rather than merely that something failed. A sandbox that rejects the right
input for the wrong reason is one refactor away from accepting it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
Nothing, or only quotes.
TooLong
Longer than MAX_PATH_BYTES.
ComponentTooLong
A component longer than MAX_COMPONENT_BYTES.
Nul
A NUL byte: the classic truncation trick against a C consumer.
Control
A control character or a space.
NonAscii
A byte outside ASCII. See the module docs: this is deliberate.
ForbiddenCharacter
A character that is legal in ASCII but not in a gunnar name.
Absolute
Still absolute after the one permitted leading / was taken off.
HomeReference
A ~ home-directory reference. The server has no home directories.
DotDot
A .. anywhere.
DotComponent
A component that is exactly ., or starts with one.
TrailingDot
A component ending in ..
LockSuffix
A component ending in .lock.
git’s own lock-file suffix. Merged in from the gunnar-ssh sandbox this
one replaced: a repository or namespace called x.lock would
collide with a lock file on the fs backend, and a ref named after it
would collide in gix-ref.
LeadingDash
A component starting with -, which reads as a command-line flag.
EmptyComponent
An empty component (a leading, trailing or doubled /).
TooFewComponents
Fewer than two components: no namespace. Multi-tenancy is not optional (multi-tenancy).
TooManyComponents
More than MAX_COMPONENTS components.
Trait Implementations§
Source§impl Clone for PathReject
impl Clone for PathReject
impl Copy for PathReject
Source§impl Debug for PathReject
impl Debug for PathReject
Source§impl Display for PathReject
impl Display for PathReject
impl Eq for PathReject
Source§impl PartialEq for PathReject
impl PartialEq for PathReject
impl StructuralPartialEq for PathReject
Auto Trait Implementations§
impl Freeze for PathReject
impl RefUnwindSafe for PathReject
impl Send for PathReject
impl Sync for PathReject
impl Unpin for PathReject
impl UnsafeUnpin for PathReject
impl UnwindSafe for PathReject
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.