[][src]Enum git_checks::FileName

pub enum FileName {
    // some variants omitted

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.


impl FileName[src]

pub fn new<P>(path: P) -> Self where
    P: AsRef<str>, 

Parse a path from Git.


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]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.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_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

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized