[−][src]Enum git_checks::impl_prelude::FileName
A representation of filenames as given by Git.
Git supports filenames with control characters and other non-Unicode byte sequence which are quoted when listed in certain Git command outputs. This enumeration smooths over these differences and offers accessors to the file name in different representations.
Generally, the as_
methods should be preferred to pattern matching on this enumeration.
Methods
impl FileName
[src]
pub fn new<P>(path: P) -> Self where
P: AsRef<str>,
[src]
P: AsRef<str>,
Parse a path from Git.
Panics
Panics if non-ASCII paths are not formatted according to Git's ls-files
formatting using
core.quotePath=true
.
pub fn as_str(&self) -> &str
[src]
The file name as a str
.
pub fn as_path(&self) -> &Path
[src]
The file name as a Path
.
pub fn as_bytes(&self) -> &[u8]
[src]
The raw bytes of the file name.
Trait Implementations
impl PartialEq<FileName> for FileName
[src]
fn eq(&self, rhs: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl AsRef<str> for FileName
[src]
impl AsRef<[u8]> for FileName
[src]
impl AsRef<OsStr> for FileName
[src]
impl AsRef<Path> for FileName
[src]
impl Eq for FileName
[src]
impl Clone for FileName
[src]
fn clone(&self) -> FileName
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for FileName
[src]
impl Display for FileName
[src]
Auto Trait Implementations
impl Send for FileName
impl Unpin for FileName
impl Sync for FileName
impl UnwindSafe for FileName
impl RefUnwindSafe for FileName
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,